home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / AX25-HOWTO < prev    next >
Text File  |  1997-11-03  |  141KB  |  3,550 lines

  1.   Linux AX25-HOWTO, Amateur Radio.
  2.   Terry Dawson, VK2KTJ, terry@perf.no.itg.telstra.com.au
  3.   v1.5, 17 October 1997
  4.  
  5.   The Linux Operating System is perhaps the only operating system in the
  6.   world that can boast native and standard support for the AX.25 packet
  7.   radio protocol utilised by Amateur Radio Operators worldwide. This
  8.   document aims to describe how to install and configure this support.
  9.  
  10.   1.  Introduction.
  11.  
  12.   This document was originally an appendix to the HAM-HOWTO, but grew
  13.   too large to be reasonably managed in that fashion. This document
  14.   describes how to install and configure the native AX.25, NetRom and
  15.   Rose support for Linux. A few typical configurations are described
  16.   that could be used as models to work from.
  17.  
  18.   The Linux implementation of the amateur radio protocols is very
  19.   flexible.  To people relatively unfamiliar with the Linux operating
  20.   system the configuration process may look daunting and complicated. It
  21.   will take you a little time to come to understand how the whole thing
  22.   fits together. You will find configuration very difficult if you have
  23.   not properly prepared yourself by learning about Linux in general. You
  24.   cannot expect to switch from some other environment to Linux without
  25.   learning about Linux itself.
  26.  
  27.   1.1.  Changes from the previous version
  28.  
  29.   Additions:
  30.           Joerg Reuters Web Page
  31.           "More Information" section
  32.           ax25ipd configuration.
  33.  
  34.   Corrections/Updates:
  35.           Changed pty's to a safer range to prevent possible conflicts
  36.           Updated module and ax25-utils versions.
  37.  
  38.   ToDo:
  39.           Fix up the SCC section, this is probably wrong.
  40.           Expand on the programming section.
  41.  
  42.   1.2.  Where to obtain new versions of this document.
  43.  
  44.   The best place to obtain the latest version of this document is from a
  45.   Linux Documentation Project archive. The Linux Documentation Project
  46.   runs a Web Server and this document appears there as the AX25-HOWTO
  47.   <http://sunsite.unc.edu/LDP/HOWTO/AX25-HOWTO.html>. This document is
  48.   also available in various formats from the sunsite.unc.edu ftp archive
  49.   <ftp://sunsite.unc.edu/pub/Linux/docs/howto/>.
  50.  
  51.   You can always contact me, but I pass new versions of the document
  52.   directly to the LDP HOWTO coordinator, so if it isn't there then
  53.   chances are I haven't finished it.
  54.  
  55.   1.3.  Other related documentation.
  56.  
  57.   There is a lot of related documentation. There are many documents that
  58.   relate to Linux networking in more general ways and I strongly
  59.   recommend you also read these as they will assist you in your efforts
  60.   and provide you with stronger insight into other possible
  61.   configurations.
  62.  
  63.   They are:
  64.  
  65.   The HAM-HOWTO <http://sunsite.unc.edu/LDP/HOWTO/HAM-HOWTO.html>,
  66.  
  67.   the NET-3-HOWTO <http://sunsite.unc.edu/LDP/HOWTO/NET-3-HOWTO.html>,
  68.  
  69.   the Ethernet-HOWTO <http://sunsite.unc.edu/LDP/HOWTO/Ethernet-
  70.   HOWTO.html>,
  71.  
  72.   and:
  73.  
  74.   the Firewall-HOWTO <http://sunsite.unc.edu/LDP/HOWTO/Firewall-
  75.   HOWTO.html>
  76.  
  77.   More general Linux information may be found by reference to other
  78.   Linux HOWTO <http://sunsite.unc.edu/LDP/HOWTO/> documents.
  79.  
  80.   2.  The Packet Radio Protocols and Linux.
  81.  
  82.   The AX.25 protocol offers both connected and connectionless modes of
  83.   operation, and is used either by itself for point-point links, or to
  84.   carry other protocols such as TCP/IP and NetRom.
  85.  
  86.   It is similar to X.25 level 2 in structure, with some extensions to
  87.   make it more useful in the amateur radio environment.
  88.  
  89.   The NetRom protocol is an attempt at a full network protocol and uses
  90.   AX.25 at its lowest layer as a datalink protocol. It provides a
  91.   network layer that is an adapted form of AX.25. The NetRom protocol
  92.   features dynamic routing and node aliases.
  93.  
  94.   The Rose protocol was conceived and first implemented by Tom Moulton
  95.   W2VY and is an implementation of the X.25 packet layer protocol and is
  96.   designed to operate with AX.25 as its datalink layer protocol. It too
  97.   provides a network layer. Rose addresses take the form of 10 digit
  98.   numbers. The first four digits are called the Data Network
  99.   Identification Code (DNIC) and are taken from Appendix B of the CCITT
  100.   X.121 recommendation. More information on the Rose protocol may be
  101.   ontained from the RATS Web server <http://www.rats.org/>.
  102.  
  103.   Alan Cox developed some early kernel based AX.25 software support for
  104.   Linux.  Jonathon Naylor <g4klx@g4klx.demon.co.uk> has taken up ongoing
  105.   development of the code, has added NetRom and Rose support and is now
  106.   the developer of the AX.25 related kernel code. DAMA support was
  107.   developed by Joerg, DL1BKE, jreuter@poboxes.com. Baycom and SoundModem
  108.   support were added by Thomas Sailer, <sailer@ife.ee.ethz.ch>. The
  109.   AX.25 utility software is now maintained by me.
  110.  
  111.   The Linux code supports KISS based TNC's (Terminal Node Controllers),
  112.   the Ottawa PI card, the Gracilis PacketTwin card and other Z8530 SCC
  113.   based cards with the generic SCC driver and both the Parallel and
  114.   Serial port Baycom modems. Thomas's new soundmodem driver supports
  115.   Soundblaster and soundcards based on the Crystal chipset.
  116.  
  117.   The User programs contain a simple PMS (Personal Message System), a
  118.   beacon facility, a line mode connect program, `listen' an example of
  119.   how to capture all AX.25 frames at raw interface level and programs to
  120.   configure the NetRom protocol. Included also are an AX.25 server style
  121.   program to handle and despatch incoming AX.25 connections and a NetRom
  122.   daemon which does most of the hard work for NetRom support.
  123.  
  124.   2.1.  How it all fits together.
  125.  
  126.   The Linux AX.25 implementation is a brand new implementation. While in
  127.   many ways it may looks similar to NOS, or BPQ or other AX.25
  128.   implementations, it is none of these and is not identical to any of
  129.   them. The Linux AX.25 implementation is capable of being configured to
  130.   behave almost identically to other implementations, but the
  131.   configuration process is very different.
  132.  
  133.   To assist you in understanding how you need to think when configuring
  134.   this section describes some of the structural features of the AX.25
  135.   implementation and how it fits into the context of the overall Linux
  136.   structure.
  137.  
  138.   Simplified Protocol Layering Diagram
  139.  
  140.        -----------------------------------------------
  141.        | AF_AX25 | AF_NETROM |  AF_INET    | AF_ROSE |
  142.        |=========|===========|=============|=========|
  143.        |         |           |             |         |
  144.        |         |           |    TCP/IP   |         |
  145.        |         |           ----------    |         |
  146.        |         |   NetRom           |    | Rose    |
  147.        |         -------------------------------------
  148.        |            AX.25                            |
  149.        -----------------------------------------------
  150.  
  151.   This diagram simply illustrates that NetRom, Rose and TCP/IP all run
  152.   directly on top of AX.25, but that each of these protocols is treated
  153.   as a seperate protocol at the programming interface. The `AF_' names
  154.   are simply the names given to the `Address Family' of each of these
  155.   protocols when writing programs to use them. The important thing to
  156.   note here is the implicit dependence on the configuration of your
  157.   AX.25 devices before you can configure your NetRom, Rose or TCP/IP
  158.   devices.
  159.  
  160.   Software module diagram of Linux Network Implementation
  161.  
  162.   ----------------------------------------------------------------------------
  163.    User    | Programs  |   call        node    ||  Daemons | ax25d  mheardd
  164.            |           |   pms         mheard  ||          | inetd  netromd
  165.   ----------------------------------------------------------------------------
  166.            | Sockets   | open(), close(), listen(), read(), write(), connect()
  167.            |           |------------------------------------------------------
  168.            |           |    AF_AX25   |  AF_NETROM  |   AF_ROSE   |  AF_INET
  169.            |------------------------------------------------------------------
  170.   Kernel   | Protocols |    AX.25     |   NetRom    |     Rose    | IP/TCP/UDP
  171.            |------------------------------------------------------------------
  172.            | Devices   |    ax0,ax1   |  nr0,nr1    | rose0,rose1 | eth0,ppp0
  173.            |------------------------------------------------------------------
  174.            | Drivers   |  Kiss   PI2   PacketTwin   SCC   BPQ     | slip ppp
  175.            |           |      Soundmodem      Baycom              | ethernet
  176.   ----------------------------------------------------------------------------
  177.   Hardware | PI2 Card, PacketTwin Card, SCC card, Serial port, Ethernet Card
  178.   ----------------------------------------------------------------------------
  179.  
  180.   This diagram is a little more general than the first. This diagram
  181.   attempts to show the relationship between user applications, the ker¡
  182.   nel and the hardware.  It also shows the relationship between the
  183.   Socket application programming interface, the actual protocol modules,
  184.   the kernel networking devices and the device drivers. Anything in this
  185.   diagram is dependent on anything underneath it, and in general you
  186.   must configure from the bottom of the diagram upwards.  So for exam¡
  187.   ple, if you want to run the call program you must also configure the
  188.   Hardware, then ensure that the kernel has the appropriate device
  189.   driver, that you create the appropriate network device, that the ker¡
  190.   nel includes the desired protocol that presents a programming inter¡
  191.   face that the call program can use. I have attempted to lay out this
  192.   document in roughly that order.
  193.  
  194.   3.  The AX.25/NetRom/Rose software components.
  195.  
  196.   The AX.25 software is comprised of three components, the kernel
  197.   source, the network configuration tools and the utility programs.
  198.  
  199.   The version 2.0.xx Linux kernels include the AX.25, NetRom, Z8530 SCC,
  200.   PI card and PacketTwin drivers by default. These have been
  201.   significantly enhanced in the 2.1.* kernels. Unfortunately, the rest
  202.   of the 2.1.*  kernels makes them fairly unstable at the moment and not
  203.   a good choice for a production system. To solve this problem Jonathon
  204.   Naylor has prepared a patch kit which will bring the amateur radio
  205.   protocol support in a 2.0.28 kernel up to the standard of the 2.1.*
  206.   kernels. This is very simple to apply, and provides a range of
  207.   facilities not present in the standard kernel such as Rose support.
  208.  
  209.   3.1.  Finding the kernel, tools and utility packages.
  210.  
  211.   3.1.1.  The kernel source:
  212.  
  213.   The kernel source can be found in its usual place at: ftp.kernel.org
  214.  
  215.        /pub/linux/kernel/v2.0/linux-2.0.31.tar.gz
  216.  
  217.   The current version of the AX25 upgrade patch is available at:
  218.   ftp.pspt.fi
  219.  
  220.        /pub/linux/ham/ax25/ax25-module-14e.tar.gz
  221.  
  222.   3.1.2.  The network tools:
  223.  
  224.   The latest alpha release of the standard Linux network tools support
  225.   AX.25 and NetRom and can be found at: ftp.inka.de
  226.  
  227.        /pub/comp/Linux/networking/net-tools/net-tools-1.33.tar.gz
  228.  
  229.   The latest ipfwadm package can be found at: ftp.xos.nl
  230.  
  231.   /pub/linux/ipfwadm/
  232.  
  233.   3.1.3.  The AX25 utilities:
  234.  
  235.   There are two different families of AX25-utilities. One is for the
  236.   2.0.* kernels and the other will work with either the 2.1.*  kernels
  237.   or the 2.0.*+moduleXX kernels. The ax25-utils version number indicates
  238.   the oldest version of kernel that they will work with. Please choose a
  239.   version of the ax25-utils appropriate to your kernel. The following
  240.   are working combinations. You must use one of the following
  241.   combinations, any other combination will not work, or will not work
  242.   well.
  243.  
  244.        Linux Kernel             AX25 Utility set
  245.        ----------------------   -------------------------
  246.        linux-2.0.29             ax25-utils-2.0.12c.tar.gz **
  247.        linux-2.0.28+module12    ax25-utils-2.1.22b.tar.gz **
  248.        linux-2.0.30+module14c   ax25-utils-2.1.42a.tar.gz
  249.        linux-2.0.31+module14d   ax25-utils-2.1.42a.tar.gz
  250.        linux-2.1.22 ++          ax25-utils-2.1.22b.tar.gz
  251.        linux-2.1.42 ++          ax25-utils-2.1.42a.tar.gz
  252.  
  253.   Note: the ax25-utils-2.0.* series (marked above with the '**' symbol)
  254.   is now obsolete and is no longer supported. This document covers
  255.   configuration using the versions of software recommended above the
  256.   table. While there are differences between the releases, most of the
  257.   information will be relevant to earlier releases of code.
  258.  
  259.   The AX.25 utility programs can be found at: ftp.pspt.fi
  260.   <ftp://ftp.pspt.fi/pub/linux/ham/ax25/>
  261.  
  262.   or at: sunsite.unc.edu <ftp://sunsite.unc.edu/pub/Linux/apps/ham/>
  263.  
  264.   4.  Installing the AX.25/NetRom/Rose software.
  265.  
  266.   To successfully install AX.25 support on your linux system you must
  267.   configure and install an appropriate kernel and then install the AX.25
  268.   utilities.
  269.  
  270.   4.1.  Compiling the kernel.
  271.  
  272.   If you are already familiar with the process of compiling the Linux
  273.   Kernel then you can skip this section, just be sure to select the
  274.   appropriate options when compiling the kernel. If you are not, then
  275.   read on.
  276.  
  277.   The normal place for the kernel source to be unpacked to is the
  278.   /usr/src directory into a subdirectory called linux.  To do this you
  279.   should be logged in as root and execute a series of commands similar
  280.   to the following:
  281.  
  282.   # mv linux linux.old
  283.   # cd /usr/src
  284.   # tar xvfz linux-2.0.31.tar.gz
  285.   # tar xvfz /pub/net/ax25/ax25-module-14e.tar.gz
  286.   # patch -p0 </usr/src/ax25-module-14/ax25-2.0.31-2.1.47-2.diff
  287.   # cd linux
  288.  
  289.   After you have unpacked the kernel source and applied the upgrade, you
  290.   need to run the configuration script and choose the options that suit
  291.   your hardware configuration and the options that you wish built into
  292.   your kernel.  You do this by using the command:
  293.  
  294.        # make menuconfig
  295.  
  296.   You might also try:
  297.  
  298.        # make config
  299.  
  300.   I'm going to describe the full screen method (menuconfig) because it
  301.   is easier to move around, but you use whichever you are most
  302.   comfortable with.
  303.  
  304.   In either case you will be offered a range of options at which you
  305.   must answer `Y' or `N'. (Note you may also answer `M' if you are using
  306.   modules.  For the sake of simplicity I will assume you are not, please
  307.   make appropriate modifications if you are).
  308.  
  309.   The options most relevant to an AX.25 configuration are:
  310.  
  311.   Code maturity level options  --->
  312.       ...
  313.       [*] Prompt for development and/or incomplete code/drivers
  314.       ...
  315.   General setup  --->
  316.       ...
  317.       [*] Networking support
  318.       ...
  319.   Networking options  --->
  320.       ...
  321.       [*] TCP/IP networking
  322.       [?] IP: forwarding/gatewaying
  323.       ...
  324.       [?] IP: tunneling
  325.       ...
  326.       [?] IP: Allow large windows (not recommended if <16Mb of memory)
  327.       ...
  328.       [*] Amateur Radio AX.25 Level 2
  329.       [?] Amateur Radio NET/ROM
  330.       [?] Amateur Radio X.25 PLP (Rose)
  331.       ...
  332.   Network device support  --->
  333.       [*] Network device support
  334.       ...
  335.       [*] Radio network interfaces
  336.       [?] BAYCOM ser12 and par96 driver for AX.25
  337.       [?] Soundcard modem driver for AX.25
  338.       [?] Soundmodem support for Soundblaster and compatible cards
  339.       [?] Soundmodem support for WSS and Crystal cards
  340.       [?] Soundmodem support for 1200 baud AFSK modulation
  341.       [?] Soundmodem support for 4800 baud HAPN-1 modulation
  342.       [?] Soundmodem support for 9600 baud FSK G3RUH modulation
  343.       [?] Serial port KISS driver for AX.25
  344.       [?] BPQ Ethernet driver for AX.25
  345.       [?] Gracilis PackeTwin support for AX.25
  346.       [?] Ottawa PI and PI/2 support for AX.25
  347.       [?] Z8530 SCC KISS emulation driver for AX.25
  348.       ...
  349.  
  350.   The options I have flagged with a `*' are those that you must must
  351.   answer `Y' to. The rest are dependent on what hardware you have and
  352.   what other options you want to include. Some of these options are
  353.   described in more detail later on, so if you don't know what you want
  354.   yet, then read ahead and come back to this step later.
  355.  
  356.   After you have completed the kernel configuration you should be able
  357.   to cleanly compile your new kernel:
  358.  
  359.        # make dep
  360.        # make clean
  361.        # make zImage
  362.  
  363.   maake sure you move your arch/i386/boot/zImage file wherever you want
  364.   it and then edit your /etc/lilo.conf file and rerun lilo to ensure
  365.   that you actually boot from it.
  366.  
  367.   4.1.1.  A word about Kernel modules
  368.  
  369.   I recommend that you don't compile any of the drivers as modules. In
  370.   nearly all installations you gain nothing but additional complexity.
  371.   Many people have problems trying to get the modularised components
  372.   working, not because the software is faulty but because modules are
  373.   more complicated to install and configure.
  374.  
  375.   If you've chosen to compile any of the components as modules, then
  376.   you'll also need to use:
  377.  
  378.        # make modules
  379.        # make modules_install
  380.  
  381.   to install your modules in the appropriate location.
  382.  
  383.   You will also need to add some entries into your /etc/conf.modules
  384.   file that will ensure that the kerneld program knows how to handle the
  385.   kernel modules. You should add/modify the following:
  386.  
  387.        alias net-pf-3     ax25
  388.        alias net-pf-6     netrom
  389.        alias net-pf-11    rose
  390.        alias tty-ldisc-1  slip
  391.        alias tty-ldisc-3  ppp
  392.        alias tty-ldisc-5  mkiss
  393.        alias bc0          baycom
  394.        alias nr0          netrom
  395.        alias pi0a         pi2
  396.        alias pt0a         pt
  397.        alias scc0         optoscc    (or one of the other scc drivers)
  398.        alias sm0          soundmodem
  399.        alias tunl0        newtunnel
  400.        alias char-major-4 serial
  401.        alias char-major-5 serial
  402.        alias char-major-6 lp
  403.  
  404.   4.1.2.  What's new in 2.0.*+ModuleXX or 2.1.* Kernels ?
  405.  
  406.   The 2.1.* kernels have enhanced versions of nearly all of the
  407.   protocols and drivers. The most significant of the enhancements are:
  408.  
  409.      modularised
  410.         the protocols and drivers have all been modularised so that you
  411.         can insmod and rmmod them whenever you wish. This reduces the
  412.         kernel memory requirements for infrequently used modules and
  413.         makes development and bug hunting much simpler. That being said,
  414.         it also makes configuration slightly more difficult.
  415.  
  416.      All drivers are now network drivers
  417.         all of the network devices such as Baycom, SCC, PI, Packettwin
  418.         etc now present a normal network interface, that is they now
  419.         look like the ethernet driver does, they no longer look like
  420.         KISS TNC's. A new utility called net2kiss allows you to build a
  421.         kiss interface to these devices if you wish.
  422.      bug fixed
  423.         there have been many bug fixes and new features added to the
  424.         drivers and protocols. The Rose protocol is one important
  425.         addition.
  426.  
  427.   4.2.  The network configuration tools.
  428.  
  429.   Now that you have compiled the kernel you should compile the new
  430.   network configuration tools. These tools allow you to modify the
  431.   configuration of network devices and to add routes to the routing
  432.   table.
  433.  
  434.   The new alpha release of the standard net-tools package includes
  435.   support for AX.25 and NetRom support. I've tested this and it seems to
  436.   work well for me.
  437.  
  438.   4.2.1.  A patch kit that adds Rose support and fixes some bugs.
  439.  
  440.   The standard net-tools-1.33.tar.gz package has some small bugs that
  441.   affect the AX.25 and NetRom support. I've made a small patch kit that
  442.   corrects these and adds Rose support to the tools as well.
  443.  
  444.   You can get the patch from: zone.pspt.fi
  445.   <ftp://zone.pspt.fi/pub/linux/ham/ax25/net-
  446.   tools-1.33.rose.tjd.diff.gz>.
  447.  
  448.   4.2.2.  Building the standard net-tools release.
  449.  
  450.   Don't forget to read the Release file and follow any instructions
  451.   there. The steps I used to compile the tools were:
  452.  
  453.        # cd /usr/src
  454.        # tar xvfz net-tools-1.33.tar.gz
  455.        # zcat net-tools-1.33.rose.tjd.diff.gz | patch -p0
  456.        # cd net-tools-1.33
  457.        # make config
  458.  
  459.   At this stage you will be presented with a series of configuration
  460.   questions, similar to the kernel configuration questions. Be sure to
  461.   include support for all of the protocols and network devices types
  462.   that you intend to use. If you do not know how to answer a particular
  463.   question then answer `Y'.
  464.  
  465.   When the compilation is complete, you should use the:
  466.  
  467.        # make install
  468.  
  469.   command to install the programs in their proper place.
  470.  
  471.   If you wish to use the IP firewall facilities then you will need the
  472.   latest firewall administration tool ipfwadm. This tool replaces the
  473.   older ipfw tool which will not work with new kernels.
  474.  
  475.   I compiled the ipfwadm utility with the following commands:
  476.  
  477.        # cd /usr/src
  478.        # tar xvfz ipfwadm-2.0beta2.tar.gz
  479.        # cd ipfwadm-2.0beta2
  480.        # make install
  481.        # cp ipfwadm.8 /usr/man/man8
  482.        # cp ipfw.4 /usr/man/man4
  483.  
  484.   4.3.  The AX.25 user and utility programs.
  485.  
  486.   After you have successfully compiled and booted your new kernel, you
  487.   need to compile the user programs. To compile and install the user
  488.   programs you should use a series of commands similar to the following:
  489.  
  490.        # cd /usr/src
  491.        # tax xvfz ax25-utils-2.1.42a.tar.gz
  492.        # cd ax25-utils-2.1.42a
  493.        # make config
  494.        # make
  495.        # make install
  496.  
  497.   The files will be installed under the /usr directory by default in
  498.   subdirectories: bin, sbin, etc and man.
  499.  
  500.   If this is a first time installation, that is you've never installed
  501.   any ax25 utilities on your machine before you should also use the:
  502.  
  503.        # make installconf
  504.  
  505.   command to install some sample configuration files into the /etc/ax25/
  506.   directory from which to work.
  507.  
  508.   If you get messages something like:
  509.  
  510.   gcc -Wall -Wstrict-prototypes -O2 -I../lib -c call.c
  511.   call.c: In function `statline':
  512.   call.c:268: warning: implicit declaration of function `attron'
  513.   call.c:268: `A_REVERSE' undeclared (first use this function)
  514.   call.c:268: (Each undeclared identifier is reported only once
  515.   call.c:268: for each function it appears in.)
  516.  
  517.   then you should double check that you have the ncurses package
  518.   properly installed on your system. The configuration script attempts
  519.   to locate your ncurses packages in the common locations, but some
  520.   installations have ncurses badly installed and it is unable to locate
  521.   them.
  522.   5.  A note on callsigns, addresses and things before we start.
  523.  
  524.   Each AX.25 and NetRom port on your system must have a callsign/ssid
  525.   allocated to it. These are configured in the configuration files that
  526.   will be described in detail later on.
  527.  
  528.   Some AX.25 implementations such as NOS and BPQ will allow you to
  529.   configure the same callsign/ssid on each AX.25 and NetRom port. For
  530.   somewhat complicated technical reasons Linux does not allow this. This
  531.   isn't as big a problem in practise as it might seem.
  532.  
  533.   This means that there are things you should be aware of and take into
  534.   consideration when doing your configurations.
  535.  
  536.   1. Each AX.25 and NetRom port must be configured with a unique
  537.      callsign/ssid.
  538.  
  539.   2. TCP/IP will use the callsign/ssid of the AX.25 port it is being
  540.      transmitted or received by, ie the one you configured for the AX.25
  541.      interface in point 1.
  542.  
  543.   3. NetRom will use the callsign/ssid specified for it in its
  544.      configuration file, but this callsign is only used when your NetRom
  545.      is speaking to another NetRom, this is not the callsign/ssid that
  546.      AX.25 users who wish to use your NetRom `node' will use. More on
  547.      this later.
  548.  
  549.   4. Rose will, by default, use the callsign/ssid of the AX.25 port,
  550.      unless the Rose callsign has been specifically set using the
  551.      `rsparms' command.  If you set a callsign/ssid using the `rsparms'
  552.      command then Rose will use this callsign/ssid on all ports.
  553.  
  554.   5. Other programs, such as the `ax25d' program can listen using any
  555.      callsign/ssid that they wish and these may be duplicated across
  556.      different ports.
  557.  
  558.   6. If you are careful with routing you can configure the same IP
  559.      address on all ports if you wish.
  560.  
  561.   5.1.  What are all those T1, T2, N2 and things ?
  562.  
  563.   Not every AX.25 implementation is a TNC2. Linux uses nomenclature that
  564.   differs in some respects from that you will be used to if your sole
  565.   experience with packet is a TNC. The following table should help you
  566.   interpret what each of the configurable items are, so that when you
  567.   come across them later in this text you'll understand what they mean.
  568.  
  569.   -------------------------------------------------------------------
  570.   Linux  | TAPR TNC | Description
  571.   -------------------------------------------------------------------
  572.   T1     | FRACK    | How long to wait before retransmitting an
  573.          |          | unacknowledged frame.
  574.   -------------------------------------------------------------------
  575.   T2     | RESPTIME | The minimum amount of time to wait for another
  576.          |          | frame to be received before transmitting
  577.          |          | an acknowledgement.
  578.   -------------------------------------------------------------------
  579.   T3     | CHECK    | The period of time we wait between sending
  580.          |          | a check that the link is still active.
  581.   -------------------------------------------------------------------
  582.   N2     | RETRY    | How many times to retransmit a frame before
  583.          |          | assuming the connection has failed.
  584.   -------------------------------------------------------------------
  585.   Idle   |          | The period of time a connection can be idle
  586.          |          | before we close it down.
  587.   -------------------------------------------------------------------
  588.   Window | MAXFRAME | The maximum number of unacknowledged
  589.          |          | transmitted frames.
  590.   -------------------------------------------------------------------
  591.  
  592.   5.2.  Run time configurable parameters
  593.  
  594.   The 2.1.* and 2.0.* +moduleXX kernels have a new feature that allows
  595.   you to change many previously unchangable parameters at run time. If
  596.   you take a careful look at the /proc/sys/net/ directory structure you
  597.   will see many files with useful names that describe various parameters
  598.   for the network configuration. The files in the /proc/sys/net/ax25/
  599.   directory each represents one configured AX.25 port. The name of the
  600.   file relates to the name of the port.
  601.  
  602.   The structure of the files in /proc/sys/net/ax25/<portname>/ is as
  603.   follows:
  604.  
  605.   FileName              Meaning              Values                  Default
  606.   ip_default_mode       IP Default Mode      0=DG 1=VC               0
  607.   ax25_default_mode     AX.25 Default Mode   0=Normal 1=Extended     0
  608.   backoff_type          Backoff              0=Linear 1=Exponential  1
  609.   connect_mode          Connected Mode       0=No 1=Yes              1
  610.   standard_window_size  Standard Window      1  <= N <= 7            2
  611.   extended_window_size  Extended Window      1  <= N <= 63           32
  612.   t1_timeout            T1 Timeout           1s <= N <= 30s          10s
  613.   t2_timeout            T2 Timeout           1s <= N <= 20s          3s
  614.   t3_timeout            T3 Timeout           0s <= N <= 3600s        300s
  615.   idle_timeout          Idle Timeout         0m <= N                 20m
  616.   maximum_retry_count   N2                   1  <= N <= 31           10
  617.   maximum_packet_length AX.25 Frame Length   1  <= N <= 512          256
  618.  
  619.   In the table T1, T2 and T3 are given in seconds, and the Idle Timeout
  620.   is given in minutes. But please note that the values used in the
  621.   sysctl interface are given in internal units where the time in seconds
  622.   is multiplied by 10, this allows resolution down to 1/10 of a second.
  623.   With timers that are allowed to be zero, eg T3 and Idle, a zero value
  624.   indicates that the timer is disabled.
  625.  
  626.   The structure of the files in /proc/sys/net/netrom/ is as follows:
  627.  
  628.   FileName                       Values                  Default
  629.   default_path_quality                                   10
  630.   link_fails_count                                       2
  631.   network_ttl_initialiser                                16
  632.   obsolescence_count_initialiser                         6
  633.   routing_control                                        1
  634.   transport_acknowledge_delay                            50
  635.   transport_busy_delay                                   1800
  636.   transport_maximum_tries                                3
  637.   transport_requested_window_size                        4
  638.   transport_timeout                                      1200
  639.  
  640.   The structure of the files in /proc/sys/net/rose/ is as follows:
  641.  
  642.   FileName                       Values                  Default
  643.   acknowledge_hold_back_timeout                          50
  644.   call_request_timeout                                   2000
  645.   clear_request_timeout                                  1800
  646.   link_fail_timeout                                      1200
  647.   maximum_virtual_circuits                               50
  648.   reset_request_timeout                                  1800
  649.   restart_request_timeout                                1800
  650.   routing_control                                        1
  651.   window_size                                            3
  652.  
  653.   To set a parameter all you need to do is write the desired value to
  654.   the file itself, for example to check and set the Rose window size
  655.   you'd use something like:
  656.  
  657.        # cat /proc/sys/net/rose/window_size
  658.        3
  659.        # echo 4 >/proc/sys/net/rose/window_size
  660.        # cat /proc/sys/net/rose/window_size
  661.        4
  662.  
  663.   6.  Configuring an AX.25 port.
  664.  
  665.   Each of the AX.25 applications read a particular configuration file to
  666.   obtain the parameters for the various AX.25 ports configured on your
  667.   Linux machine.  For AX.25 ports the file that is read is the
  668.   /etc/ax25/axport file.  You must have an entry in this file for each
  669.   AX.25 port you want on your system.
  670.  
  671.   6.1.  Creating the AX.25 network device.
  672.  
  673.   The network device is what is listed when you use the `ifconfig'
  674.   command. This is the object that the Linux kernel sends and receives
  675.   network data from. Nearly always the network device has a physical
  676.   port associated with it, but there are occasions where this isn't
  677.   necessary. The network device does relate directly to a device driver.
  678.  
  679.   In the Linux AX.25 code there are a number of device drivers. The most
  680.   common is probably the KISS driver, but others are the SCC driver(s),
  681.   the Baycom driver and the SoundModem driver.
  682.   Each of these device drivers will create a network device when it is
  683.   started.
  684.  
  685.   6.1.1.  Creating a KISS device.
  686.  
  687.   Kernel Compile Options:
  688.  
  689.        General setup  --->
  690.            [*] Networking support
  691.        Network device support  --->
  692.            [*] Network device support
  693.            ...
  694.            [*] Radio network interfaces
  695.            [*] Serial port KISS driver for AX.25
  696.  
  697.   Probably the most common configuration will be for a KISS TNC on a
  698.   serial port.  You will need to have the TNC preconfigured and
  699.   connected to your serial port.  You can use a communications program
  700.   like minicom or seyon to configure the TNC into kiss mode.
  701.  
  702.   To create a KISS device you use the kissattach program. In it simplest
  703.   form you can use the kissattach program as follows:
  704.  
  705.        # /usr/sbin/kissattach /dev/ttyS0 radio
  706.        # kissparms -p radio -t 100 -s 100 -r 25
  707.  
  708.   The kissattach command will create a KISS network device. These
  709.   devices are called `ax[0-9]'. The first time you use the kissattach
  710.   command it creates `ax0', the second time it creates `ax1' etc. Each
  711.   KISS device has an associated serial port.
  712.  
  713.   The kissparms command allows you to set various KISS parameters on a
  714.   KISS device.
  715.  
  716.   Specifically the example presented would create a KISS network device
  717.   using the serial device `/dev/ttyS0' and the entry from the
  718.   /etc/ax25/axports with a port name of `radio'. It then configures it
  719.   with a txdelay and slottime of 100 milliseconds and a ppersist value
  720.   of 25.
  721.  
  722.   Please refer to the man pages for more information.
  723.  
  724.   6.1.1.1.  Configuring for Dual Port TNC's
  725.  
  726.   The mkiss utility included in the ax25-utils distribution allows you
  727.   to make use of both modems on a dual port TNC. Configuration is fairly
  728.   simple. It works by taking a single serial device connected to a
  729.   single multiport TNC and making it look like a number of devices each
  730.   connected to a single port TNC. You do this before you do any of the
  731.   AX.25 configuration. The devices that you then do the AX.25
  732.   configuration on are pseudo-TTY interfaces, (/dev/ttyq*), and not the
  733.   actual serial device. Pseudo-TTY devices create a kind of pipe through
  734.   which programs designed to talk to tty devices can talk to other
  735.   programs designed to talk to tty devices. Each pipe has a master and a
  736.   slave end. The master end is generally called `/dev/ptyq*' and the
  737.   slave ends are called `/dev/ttyq*'. There is a one to one relationship
  738.   between masters and slaves, so /dev/ptyq0 is the master end of a pipe
  739.   with /dev/ttyq0 as its slave. You must open the master end of a pipe
  740.   before opening the slave end. mkiss exploits this mechanism to split a
  741.   single serial device into seperate devices.
  742.  
  743.   Example: if you have a dual port tnc and it is connected to your
  744.   /dev/ttyS0 serial device at 9600 bps, the command:
  745.  
  746.        # /usr/sbin/mkiss -s 9600 /dev/ttyS0 /dev/ptyq0 /dev/ptyq1
  747.        # /usr/sbin/kissattach /dev/ttyq0 port1
  748.        # /usr/sbin/kissattach /dev/ttyq1 port2
  749.  
  750.   would create two pseudo-tty devices that each look like a normal
  751.   single port TNC. You would then treat /dev/ttyq0 and /dev/ttyq1 just
  752.   as you would a conventional serial device with TNC connected. This
  753.   means you'd then use the kissattach command as described above, on
  754.   each of those, in the example for AX.25 ports called port1 and port2.
  755.   You shouldn't use kissattach on the actual serial device as the mkiss
  756.   program uses it.
  757.  
  758.   The mkiss command has a number of optional arguments that you may wish
  759.   to use. They are summarised as follows:
  760.  
  761.      -c enables the addition of a one byte checksum to each KISS frame.
  762.         This is not supported by most KISS implementation, it is
  763.         supported by the G8BPG KISS rom.
  764.  
  765.      -s <speed>
  766.         sets the speed of the serial port.
  767.  
  768.      -h enables hardware handshaking on the serial port, it is off by
  769.         default. Most KISS implementation do not support this, but some
  770.         do.
  771.  
  772.      -l enables logging of information to the syslog logfile.
  773.  
  774.   6.1.2.  Creating a Baycom device.
  775.  
  776.   Kernel Compile Options:
  777.  
  778.        Code maturity level options  --->
  779.            [*] Prompt for development and/or incomplete code/drivers
  780.        General setup  --->
  781.            [*] Networking support
  782.        Network device support  --->
  783.            [*] Network device support
  784.            ...
  785.            [*] Radio network interfaces
  786.            [*] BAYCOM ser12 and par96 driver for AX.25
  787.  
  788.   Thomas Sailer, <sailer@ife.ee.ethz.ch>, despite the popularly held
  789.   belief that it would not work very well, has developed Linux support
  790.   for Baycom modems. His driver supports the Ser12 serial port, Par96
  791.   and the enhanced PicPar parallel port modems.  Further information
  792.   about the modems themselves may be obtained from the Baycom Web site
  793.   <http://www.baycom.de/>.
  794.  
  795.   Your first step should be to determine the i/o and addresses of the
  796.   serial or parallel port(s) you have Baycom modem(s) connected to.
  797.   When you have these you must configure the Baycom driver with them.
  798.  
  799.   The BayCom driver creates network devices called: bc0, bc1, bc2 etc.
  800.   when it is configured.
  801.  
  802.   The sethdlc utility allows you to configure the driver with these
  803.   parameters, or, if you have only one Baycom modem installed you may
  804.   specify the parameters on the insmod commmand line when you load the
  805.   Baycom module.
  806.  
  807.   For example, a simple configuration.  Disable the serial driver for
  808.   COM1: then configure the Baycom driver for a Ser12 serial port modem
  809.   on COM1: with the software DCD option enabled:
  810.  
  811.        # setserial /dev/ttyS0 uart none
  812.        # insmod hdlcdrv
  813.        # insmod baycom mode="ser12*" iobase=0x3f8 irq=4
  814.  
  815.   Par96 parallel port type modem on LPT1: using hardware DCD detection:
  816.  
  817.        # insmod hdlcdrv
  818.        # insmod baycom mode="par96" iobase=0x378 irq=7 options=0
  819.  
  820.   This is not really the preferred way to do it. The sethdlc utility
  821.   works just as easily with one device as with many.
  822.  
  823.   The sethdlc man page has the full details, but a couple of examples
  824.   will illustrate the most important aspects of this configuration. The
  825.   following examples assume you have already loaded the Baycom module
  826.   using:
  827.  
  828.        # insmod hdlcdrv
  829.        # insmod baycom
  830.  
  831.   or that you compiled the kernel with the driver inbuilt.
  832.  
  833.   Configure the bc0 device driver as a Parallel port Baycom modem on
  834.   LPT1: with software DCD:
  835.  
  836.        # sethdlc -p -i bc0 mode par96 io 0x378 irq 7
  837.  
  838.   Configure the bc1 device driver as a Serial port Baycom modem on COM1:
  839.  
  840.   # sethdlc -p -i bc1 mode "ser12*" io 0x3f8 irq 4
  841.  
  842.   6.1.3.  Configuring the AX.25 channel access parameters.
  843.  
  844.   The AX.25 channel access parameters are the equivalent of the KISS
  845.   ppersist, txdelay and slottime type parameters. Again you use the
  846.   sethdlc utility for this.
  847.  
  848.   Again the sethdlc man page is the source of the most complete
  849.   information but another example of two won't hurt:
  850.  
  851.   Configure the bc0 device with TxDelay of 200 mS, SlotTime of 100 mS,
  852.   PPersist of 40 and half duplex:
  853.  
  854.        # sethdlc -i bc0 -a txd 200 slot 100 ppersist 40 half
  855.  
  856.   Note that the timing values are in milliseconds.
  857.  
  858.   6.1.3.1.  Configuring the Kernel AX.25 to use the BayCom device
  859.  
  860.   The BayCom driver creates standard network devices that the AX.25
  861.   Kernel code can use. Configuration is much the same as that for a PI
  862.   or PacketTwin card.
  863.  
  864.   The first step is to configure the device with an AX.25 callsign. The
  865.   ifconfig utility may be used to perform this.
  866.  
  867.        # /sbin/ifconfig bc0 hw ax25 VK2KTJ-15 up
  868.  
  869.   will assign the BayCom device bc0 the AX.25 callsign VK2KTJ-15.
  870.   Alternatively you can use the axparms command, you'll still need to
  871.   use the ifconfig command to bring the device up though:
  872.  
  873.        # ifconfig bc0 up
  874.        # axparms -setcall bc0 vk2ktj-15
  875.  
  876.   The next step is to create an entry in the /etc/ax25/axports file as
  877.   you would for any other device. The entry in the axports file is
  878.   associated with the network device you've configured by the callsign
  879.   you configure. The entry in the axports file that has the callsign
  880.   that you configured the BayCom device with is the one that will be
  881.   used to refer to it.
  882.  
  883.   You may then treat the new AX.25 device as you would any other. You
  884.   can configure it for TCP/IP, add it to ax25d and run NetRom or Rose
  885.   over it as you please.
  886.  
  887.   6.1.4.  Creating a SoundModem device.
  888.  
  889.   Kernel Compile Options:
  890.  
  891.        Code maturity level options  --->
  892.            [*] Prompt for development and/or incomplete code/drivers
  893.        General setup  --->
  894.            [*] Networking support
  895.        Network device support  --->
  896.            [*] Network device support
  897.            ...
  898.            [*] Radio network interfaces
  899.            [*] Soundcard modem driver for AX.25
  900.            [?] Soundmodem support for Soundblaster and compatible cards
  901.            [?] Soundmodem support for WSS and Crystal cards
  902.            [?] Soundmodem support for 1200 baud AFSK modulation
  903.            [?] Soundmodem support for 4800 baud HAPN-1 modulation
  904.            [?] Soundmodem support for 9600 baud FSK G3RUH modulation
  905.  
  906.   Thomas Sailer has built a new driver for the kernel that allows you to
  907.   use your soundcard as a modem. Connect your radio directly to your
  908.   soundcard to play packet! Thomas recommends at least a 486DX2/66 if
  909.   you want to use this software as all of the digital signal processing
  910.   is done by the main CPU.
  911.  
  912.   The driver currently emulates 1200 bps AFSK, 4800 HAPN and 9600 FSK
  913.   (G3RUH compatible) modem types. The only sound cards currently
  914.   supported are SoundBlaster and WindowsSoundSystem Compatible models.
  915.   The sound cards require some circuitry to help them drive the Push-To-
  916.   Talk circuitry, and information on this is available from Thomas's
  917.   SoundModem PTT circuit web page
  918.   <http://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.html>. There are
  919.   quite a few possible options, they are: detect the sound output from
  920.   the soundcard, or use output from a parallel port, serial port or midi
  921.   port. Circuit examples for each of these are on Thomas's site.
  922.  
  923.   The SoundModem driver creates network devices called: sm0, sm1, sm2
  924.   etc when it is configured.
  925.  
  926.   Note: the SoundModem driver competes for the same resources as the
  927.   Linux sound driver. So if you wish to use the SoundModem driver you
  928.   must ensure that the Linux sound driver is not installed. You can of
  929.   course compile them both as modules and insert and remove them as you
  930.   wish.
  931.  
  932.   6.1.4.1.  Configuring the sound card.
  933.  
  934.   The SoundModem driver does not initialise the sound card. The
  935.   ax25-utils package includes a utility to do this called `setcrystal'
  936.   that may be used for SoundCards based on the Crystal chipset. If you
  937.   have some other card then you will have to use some other software to
  938.   initialise it.  Its syntax is fairly straightforward:
  939.  
  940.        setcrystal [-w wssio] [-s sbio] [-f synthio] [-i irq] [-d dma] [-c dma2]
  941.  
  942.   So, for example, if you wished to configure a soundblaster card at i/o
  943.   base address 0x388, irq 10 and DMA 1 you would use:
  944.        # setcrystal -s 0x388 -i 10 -d 1
  945.  
  946.   To configure a WindowSoundSystem card at i/o base address 0x534, irq
  947.   5, DMA 3 you would use:
  948.  
  949.        # setcrystal -w 0x534 -i 5 -d 3
  950.  
  951.   The [-f synthio] parameter is the set the synthesiser address, and the
  952.   [-c dma2] parameter is to set the second DMA channel to allow full
  953.   duplex operation.
  954.  
  955.   6.1.4.2.  Configuring the SoundModem driver.
  956.  
  957.   When you have configured the soundcard you need to configure the
  958.   driver telling it where the sound card is located and what sort of
  959.   modem you wish it to emulate.
  960.  
  961.   The sethdlc utility allows you to configure the driver with these
  962.   parameters, or, if you have only one soundcard installed you may
  963.   specify the parameters on the insmod commmand line when you load the
  964.   SoundModem module.
  965.  
  966.   For example, a simple configuration, with one SoundBlaster soundcard
  967.   configured as described above emulating a 1200 bps modem:
  968.  
  969.        # insmod hdlcdrv
  970.        # insmod soundmodem mode="sbc:afsk1200" iobase=0x220 irq=5 dma=1
  971.  
  972.   This is not really the preferred way to do it. The sethdlc utility
  973.   works just as easily with one device as with many.
  974.  
  975.   The sethdlc man page has the full details, but a couple of examples
  976.   will illustrate the most important aspects of this configuration. The
  977.   following examples assume you have already loaded the SoundModem
  978.   modules using:
  979.  
  980.        # insmod hdlcdrv
  981.        # insmod soundmodem
  982.  
  983.   or that you compiled the kernel with the driver inbuilt.
  984.  
  985.   Configure the driver to support the WindowsSoundSystem card we
  986.   configured above to emulate a G3RUH 9600 compatible modem as device
  987.   sm0 using a parallel port at 0x378 to key the Push-To-Talk:
  988.  
  989.        # sethdlc -p -i sm0 mode wss:fsk9600 io 0x534 irq 5 dma 3 pario 0x378
  990.  
  991.   Configure the driver to support the SoundBlaster card we configured
  992.   above to emulate a 4800 bps HAPN modem as device sm1 using the serial
  993.   port located at 0x2f8 to key the Push-To-Talk:
  994.  
  995.        # sethdlc -p -i sm1 mode sbc:hapn4800 io 0x388 irq 10 dma 1 serio 0x2f8
  996.  
  997.   Configure the driver to support the SoundBlaster card we configured
  998.   above to emulate a 1200 bps AFSK modem as device sm1 using the serial
  999.   port located at 0x2f8 to key the Push-To-Talk:
  1000.  
  1001.        # sethdlc -p -i sm1 mode sbc:afsk1200 io 0x388 irq 10 dma 1 serio 0x2f8
  1002.  
  1003.   6.1.4.3.  Configuring the AX.25 channel access parameters.
  1004.  
  1005.   The AX.25 channel access parameters are the equivalent of the KISS
  1006.   ppersist, txdelay and slottime type parameters. You use the sethdlc
  1007.   utility for this as well.
  1008.  
  1009.   Again the sethdlc man page is the source of the most complete
  1010.   information but another example of two won't hurt:
  1011.  
  1012.   Configure the sm0 device with TxDelay of 100 mS, SlotTime of 50mS,
  1013.   PPersist of 128 and full duplex:
  1014.  
  1015.        # sethdlc -i sm0 -a txd 100 slot 50 ppersist 128 full
  1016.  
  1017.   Note that the timing values are in milliseconds.
  1018.  
  1019.   6.1.4.4.  Setting the audio levels and tuning the driver.
  1020.  
  1021.   It is very important that the audio levels be set correctly for any
  1022.   radio based modem to work. This is equally true of the SoundModem.
  1023.   Thomas has developed some utility programs that make this task easier.
  1024.   They are called smdiag and smmixer.
  1025.  
  1026.      smdiag
  1027.         provides two types of display, either an oscilloscope type
  1028.         display or an eye pattern type display.
  1029.  
  1030.      smmixer
  1031.         allows you to actually adjust the transmit and receive audio
  1032.         levels.
  1033.  
  1034.   To start the smdiag utility in 'eye' mode for the SoundModem device
  1035.   sm0 you would use:
  1036.  
  1037.        # smdiag -i sm0 -e
  1038.  
  1039.   To start the smmixer utility for the SoundModem device sm0 you would
  1040.   use:
  1041.  
  1042.        # smmixer -i sm0
  1043.  
  1044.   6.1.4.5.  Configuring the Kernel AX.25 to use the SoundModem
  1045.  
  1046.   The SoundModem driver creates standard network devices that the AX.25
  1047.   Kernel code can use. Configuration is much the same as that for a PI
  1048.   or PacketTwin card.
  1049.  
  1050.   The first step is to configure the device with an AX.25 callsign.  The
  1051.   ifconfig utility may be used to perform this.
  1052.  
  1053.        # /sbin/ifconfig sm0 hw ax25 VK2KTJ-15 up
  1054.  
  1055.   will assign the SoundModem device sm0 the AX.25 callsign VK2KTJ-15.
  1056.   Alternatively you can use the axparms command, but you still need the
  1057.   ifconfig utility to bring the device up:
  1058.  
  1059.        # ifconfig sm0 up
  1060.        # axparms -setcall sm0 vk2ktj-15
  1061.  
  1062.   The next step is to create an entry in the /etc/ax25/axports file as
  1063.   you would for any other device. The entry in the axports file is
  1064.   associated with the network device you've configured by the callsign
  1065.   you configure. The entry in the axports file that has the callsign
  1066.   that you configured the SoundModem device with is the one that will be
  1067.   used to refer to it.
  1068.  
  1069.   You may then treat the new AX.25 device as you would any other. You
  1070.   can configure it for TCP/IP, add it to ax25d and run NetRom or Rose
  1071.   over it as you please.
  1072.  
  1073.   6.1.5.  Creating a PI card device.
  1074.  
  1075.   Kernel Compile Options:
  1076.  
  1077.        General setup  --->
  1078.            [*] Networking support
  1079.        Network device support  --->
  1080.            [*] Network device support
  1081.            ...
  1082.            [*] Radio network interfaces
  1083.            [*] Ottawa PI and PI/2 support for AX.25
  1084.  
  1085.   The PI card device driver creates devices named `pi[0-9][ab]'. The
  1086.   first PI card detected will be allocated `pi0', the second `pi1' etc.
  1087.   The `a' and `b' refer to the first and second physical interface on
  1088.   the PI card. If you have built your kernel to include the PI card
  1089.   driver, and the card has been properly detected then you can use the
  1090.   following command to configure the network device:
  1091.  
  1092.        # /sbin/ifconfig pi0a hw ax25 VK2KTJ-15 up
  1093.  
  1094.   This command would configure the first port on the first PI card
  1095.   detected with the callsign VK2KTJ-15 and make it active. To use the
  1096.   device all you now need to do is to configure an entry into your
  1097.   /etc/ax25/axports file with a matching callsign/ssid and you will be
  1098.   ready to continue on.
  1099.  
  1100.   The PI card driver was written by David Perry, <dp@hydra.carleton.edu>
  1101.  
  1102.   6.1.6.  Creating a PacketTwin device.
  1103.  
  1104.   Kernel Compile Options:
  1105.  
  1106.        General setup  --->
  1107.            [*] Networking support
  1108.        Network device support  --->
  1109.            [*] Network device support
  1110.            ...
  1111.            [*] Radio network interfaces
  1112.            [*] Gracilis PackeTwin support for AX.25
  1113.  
  1114.   The PacketTwin card device driver creates devices named `pt[0-9][ab]'.
  1115.   The first PacketTwin card detected will be allocated `pt0', the second
  1116.   `pt1' etc. The `a' and `b' refer to the first and second physical
  1117.   interface on the PacketTwin card. If you have built your kernel to
  1118.   include the PacketTwin card driver, and the card has been properly
  1119.   detected then you can use the following command to configure the
  1120.   network device:
  1121.  
  1122.        # /sbin/ifconfig pt0a hw ax25 VK2KTJ-15 up
  1123.  
  1124.   This command would configure the first port on the first PacketTwin
  1125.   card detected with the callsign VK2KTJ-15 and make it active. To use
  1126.   the device all you now need to do is to configure an entry into your
  1127.   /etc/ax25/axports file with a matching callsign/ssid and you will be
  1128.   ready to continue on.
  1129.  
  1130.   The PacketTwin card driver was written by Craig Small VK2XLZ,
  1131.   <csmall@triode.apana.org.au>.
  1132.  
  1133.   6.1.7.  Creating a generic SCC device.
  1134.  
  1135.   Kernel Compile Options:
  1136.  
  1137.        General setup  --->
  1138.            [*] Networking support
  1139.        Network device support  --->
  1140.            [*] Network device support
  1141.            ...
  1142.            [*] Radio network interfaces
  1143.            [*] Z8530 SCC KISS emulation driver for AX.25
  1144.  
  1145.   Joerg Reuter, DL1BKE, jreuter@poboxes.com has developed generic
  1146.   support for Z8530 SCC based cards. His driver is configurable to
  1147.   support a range of different types of cards and present an interface
  1148.   that looks like a KISS TNC so you can treat it as though it were a
  1149.   KISS TNC.
  1150.  
  1151.   6.1.7.1.  Obtaining and building the configuration tool package.
  1152.  
  1153.   While the kernel driver is included in the standard kernel
  1154.   distribution, Joerg distributes more recent versions of his driver
  1155.   with the suite of configuration tools that you will need to obtain as
  1156.   well.
  1157.  
  1158.   You can obtain the configuration tools package from:
  1159.  
  1160.   Joerg's web page <http://www.rat.de/jr/>
  1161.  
  1162.   or:
  1163.  
  1164.   db0bm.automation.fh-aachen.de
  1165.  
  1166.        /incoming/dl1bke/
  1167.  
  1168.   or:
  1169.  
  1170.   insl1.etec.uni-karlsruhe.de
  1171.  
  1172.        /pub/hamradio/linux/z8530/
  1173.  
  1174.   or:
  1175.  
  1176.   ftp.ucsd.edu
  1177.  
  1178.        /hamradio/packet/tcpip/linux
  1179.        /hamradio/packet/tcpip/incoming/
  1180.  
  1181.   You will find multiple versions, choose the one that best suits the
  1182.   kernel you intend to use:
  1183.  
  1184.   z8530drv-2.4a.dl1bke.tar.gz   2.0.*
  1185.   z8530drv-utils-3.0.tar.gz    2.1.6 or greater
  1186.  
  1187.   The following commands were what I used to compile and install the
  1188.   package for kernel version 2.0.30:
  1189.  
  1190.        # cd /usr/src
  1191.        # gzip -dc z8530drv-2.4a.dl1bke.tar.gz | tar xvpofz -
  1192.        # cd z8530drv
  1193.        # make clean
  1194.        # make dep
  1195.        # make module         # If you want to build the driver as a module
  1196.        # make for_kernel     # If you want the driver to built into your kernel
  1197.        # make install
  1198.  
  1199.   After the above is complete you should have three new programs
  1200.   installed in your /sbin directory: gencfg, sccinit and sccstat. It is
  1201.   these programs that you will use to configure the driver for your
  1202.   card.
  1203.  
  1204.   You will also have a group of new special device files created in your
  1205.   /dev called scc0-scc7. These will be used later and will be the `KISS'
  1206.   devices you will end up using.
  1207.  
  1208.   If you chose to 'make for_kernel' then you will need to recompile your
  1209.   kernel. To ensure that you include support for the z8530 driver you
  1210.   must be sure to answer `Y' to: `Z8530 SCC kiss emulation driver for
  1211.   AX.25' when asked during a kernel `make config'.
  1212.  
  1213.   If you chose to 'make module' then the new scc.o will have been
  1214.   installed in the appropriate /lib/modules directory and you do not
  1215.   need to recompile your kernel. Remember to use the insmod command to
  1216.   load the module before your try and configure it.
  1217.  
  1218.   6.1.7.2.  Configuring the driver for your card.
  1219.  
  1220.   The z8530 SCC driver has been designed to be as flexible as possible
  1221.   so as to support as many different types of cards as possible. With
  1222.   this flexibility has come some cost in configuration.
  1223.  
  1224.   There is more comprehensive documentation in the package and you
  1225.   should read this if you have any problems. You should particularly
  1226.   look at doc/scc_eng.doc or doc/scc_ger.doc for more detailed
  1227.   information. I've paraphrased the important details, but as a result
  1228.   there is a lot of lower level detail that I have not included.
  1229.  
  1230.   The main configuration file is read by the sccinit program and is
  1231.   called /etc/z8530drv.conf. This file is broken into two main stages:
  1232.   Configuration of the hardware parameters and channel configuration.
  1233.   After you have configured this file you need only add:
  1234.  
  1235.   # sccinit
  1236.  
  1237.   into the rc file that configures your network and the driver will be
  1238.   initialised according to the contents of the configuration file. You
  1239.   must do this before you attempt to use the driver.
  1240.  
  1241.   6.1.7.2.1.  Configuration of the hardware parameters.
  1242.  
  1243.   The first section is broken into stanzas, each stanza representing an
  1244.   8530 chip. Each stanza is a list of keywords with arguments. You may
  1245.   specify up to four SCC chips in this file by default. The #define
  1246.   MAXSCC 4 in scc.c can be increased if you require support for more.
  1247.  
  1248.   The allowable keywords and arguments are:
  1249.  
  1250.      chip
  1251.         the chip keyword is used to separate stanzas. It will take
  1252.         anything as an argument. The arguments are not used.
  1253.  
  1254.      data_a
  1255.         this keyword is used to specify the address of the data port for
  1256.         the z8530 channel `A'. The argument is a hexadecimal number e.g.
  1257.         0x300
  1258.  
  1259.      ctrl_a
  1260.         this keyword is used to specify the address of the control port
  1261.         for the z8530 channel `A'. The arguments is a hexadecimal number
  1262.         e.g. 0x304
  1263.  
  1264.      data_b
  1265.         this keyword is used to specify the address of the data port for
  1266.         the z8530 channel `B'. The argument is a hexadecimal number e.g.
  1267.         0x301
  1268.  
  1269.      ctrl_b
  1270.         this keyword is used to specify the address of the control port
  1271.         for the z8530 channel `B'. The arguments is a hexadecimal number
  1272.         e.g. 0x305
  1273.  
  1274.      irq
  1275.         this keyword is used to specify the IRQ used by the 8530 SCC
  1276.         described in this stanza. The argument is an integer e.g. 5
  1277.  
  1278.      pclock
  1279.         this keyword is used to specify the frequency of the clock at
  1280.         the PCLK pin of the 8530. The argument is an integer frequency
  1281.         in Hz which defaults to 4915200 if the keyword is not supplied.
  1282.  
  1283.      board
  1284.         the type of board supporting this 8530 SCC. The argument is a
  1285.         character string. The allowed values are:
  1286.  
  1287.         PA0HZP
  1288.            the PA0HZP SCC Card
  1289.  
  1290.         EAGLE
  1291.            the Eagle card
  1292.  
  1293.         PC100
  1294.            the DRSI PC100 SCC card
  1295.         PRIMUS
  1296.            the PRIMUS-PC (DG9BL) card
  1297.  
  1298.         BAYCOM
  1299.            BayCom (U)SCC card
  1300.  
  1301.      escc
  1302.         this keyword is optional and is used to enable support for the
  1303.         Extended SCC chips (ESCC) such as the 8580, 85180, or the 85280.
  1304.         The argument is a character string with allowed values of `yes'
  1305.         or `no'. The default is `no'.
  1306.  
  1307.      vector
  1308.         this keyword is optional and specifies the address of the vector
  1309.         latch (also known as "intack port") for PA0HZP cards. There can
  1310.         be only one vector latch for all chips. The default is 0.
  1311.  
  1312.      special
  1313.         this keyword is optional and specifies the address of the
  1314.         special function register on several cards. The default is 0.
  1315.  
  1316.      option
  1317.         this keyword is optional and defaults to 0.
  1318.  
  1319.   Some example configurations for the more popular cards are as follows:
  1320.  
  1321.      BayCom USCC
  1322.  
  1323.           chip    1
  1324.           data_a  0x300
  1325.           ctrl_a  0x304
  1326.           data_b  0x301
  1327.           ctrl_b  0x305
  1328.           irq     5
  1329.           board   BAYCOM
  1330.           #
  1331.           # SCC chip 2
  1332.           #
  1333.           chip    2
  1334.           data_a  0x302
  1335.           ctrl_a  0x306
  1336.           data_b  0x303
  1337.           ctrl_b  0x307
  1338.           board   BAYCOM
  1339.  
  1340.      PA0HZP SCC card
  1341.  
  1342.      chip 1
  1343.      data_a 0x153
  1344.      data_b 0x151
  1345.      ctrl_a 0x152
  1346.      ctrl_b 0x150
  1347.      irq 9
  1348.      pclock 4915200
  1349.      board PA0HZP
  1350.      vector 0x168
  1351.      escc no
  1352.      #
  1353.      #
  1354.      #
  1355.      chip 2
  1356.      data_a 0x157
  1357.      data_b 0x155
  1358.      ctrl_a 0x156
  1359.      ctrl_b 0x154
  1360.      irq 9
  1361.      pclock 4915200
  1362.      board PA0HZP
  1363.      vector 0x168
  1364.      escc no
  1365.  
  1366.      DRSI SCC card
  1367.  
  1368.           chip 1
  1369.           data_a 0x303
  1370.           data_b 0x301
  1371.           ctrl_a 0x302
  1372.           ctrl_b 0x300
  1373.           irq 7
  1374.           pclock 4915200
  1375.           board DRSI
  1376.           escc no
  1377.  
  1378.   If you already have a working configuration for your card under NOS,
  1379.   then you can use the gencfg command to convert the PE1CHL NOS driver
  1380.   commands into a form suitable for use in the z8530 driver
  1381.   configuration file.
  1382.  
  1383.   To use gencfg you simply invoke it with the same parameters as you
  1384.   used for the PE1CHL driver in NET/NOS. For example:
  1385.  
  1386.        # gencfg 2 0x150 4 2 0 1 0x168 9 4915200
  1387.  
  1388.   will generate a skeleton configuration for the OptoSCC card.
  1389.  
  1390.   6.1.7.3.  Channel Configuration
  1391.  
  1392.   The Channel Configuration section is where you specify all of the
  1393.   other parameters associated with the port you are configuring. Again
  1394.   this section is broken into stanzas. One stanza represents one logical
  1395.   port, and therefore there would be two of these for each one of the
  1396.   hardware parameters stanzas as each 8530 SCC supports two ports.
  1397.  
  1398.   These keywords and arguments are also written to the
  1399.   /etc/z8530drv.conf file and must appear after the hardware parameters
  1400.   section.
  1401.  
  1402.   Sequence is very important in this section, but if you stick with the
  1403.   suggested sequence it should work ok. The keywords and arguments are:
  1404.  
  1405.      device
  1406.         this keyword must be the first line of a port definition and
  1407.         specifies the name of the special device file that the rest of
  1408.         the configuration applies to. e.g. /dev/scc0
  1409.  
  1410.      speed
  1411.         this keyword specifies the speed in bits per second of the
  1412.         interface. The argument is an integer: e.g. 1200
  1413.  
  1414.      clock
  1415.         this keyword specifies where the clock for the data will be
  1416.         sourced. Allowable values are:
  1417.  
  1418.         dpll
  1419.            normal halfduplex operation
  1420.  
  1421.         external
  1422.            MODEM supplies its own Rx/Tx clock
  1423.  
  1424.         divider
  1425.            use fullduplex divider if installed.
  1426.  
  1427.      mode
  1428.         this keyword specifies the data coding to be used. Allowable
  1429.         arguments are: nrzi or nrz
  1430.  
  1431.      rxbuffers
  1432.         this keyword specifies the number of receive buffers to allocate
  1433.         memory for. The argument is an integer, e.g. 8.
  1434.  
  1435.      txbuffers
  1436.         this keyword specifies the number of transmit buffers to
  1437.         allocate memory for. The argument is an integer, e.g. 8.
  1438.  
  1439.      bufsize
  1440.         this keyword specifies the size of the receive and transmit
  1441.         buffers. The arguments is in bytes and represents the total
  1442.         length of the frame, so it must also take into account the AX.25
  1443.         headers and not just the length of the data field. This keyword
  1444.         is optional and default to 384
  1445.  
  1446.      txdelay
  1447.         the KISS transmit delay value, the argument is an integer in mS.
  1448.  
  1449.      persist
  1450.         the KISS persist value, the argument is an integer.
  1451.  
  1452.      slot
  1453.         the KISS slot time value, the argument is an integer in mS.
  1454.  
  1455.      tail
  1456.         the KISS transmit tail value, the argument is an integer in mS.
  1457.  
  1458.      fulldup
  1459.         the KISS full duplex flag, the argument is an integer.  1==Full
  1460.         Duplex, 0==Half Duplex.
  1461.  
  1462.      wait
  1463.         the KISS wait value, the argument is an integer in mS.
  1464.  
  1465.      min
  1466.         the KISS min value, the argument is an integer in S.
  1467.  
  1468.      maxkey
  1469.         the KISS maximum keyup time, the argument is an integer in S.
  1470.  
  1471.      idle
  1472.         the KISS idle timer value, the argument is an integer in S.
  1473.  
  1474.      maxdef
  1475.         the KISS maxdef value, the argument is an integer.
  1476.  
  1477.      group
  1478.         the KISS group value, the argument is an integer.
  1479.  
  1480.      txoff
  1481.         the KISS txoff value, the argument is an integer in mS.
  1482.  
  1483.      softdcd
  1484.         the KISS softdcd value, the argument is an integer.
  1485.  
  1486.      slip
  1487.         the KISS slip flag, the argument is an integer.
  1488.  
  1489.   6.1.7.4.  Using the driver.
  1490.  
  1491.   To use the driver you simply treat the /dev/scc* devices just as you
  1492.   would a serial tty device with a KISS TNC connected to it. For
  1493.   example, to configure Linux Kernel networking to use your SCC card you
  1494.   could use something like:
  1495.  
  1496.        # kissattach -s 4800 /dev/scc0 VK2KTJ
  1497.  
  1498.   You can also use NOS to attach to it in precisely the same way. From
  1499.   JNOS for example you would use something like:
  1500.  
  1501.        attach asy scc0 0 ax25 scc0 256 256 4800
  1502.  
  1503.   6.1.7.5.  The sccstat and sccparam tools.
  1504.  
  1505.   To assist in the diagnosis of problems you can use the sccstat program
  1506.   to display the current configuration of an SCC device. To use it try:
  1507.  
  1508.        # sccstat /dev/scc0
  1509.  
  1510.   you will displayed a very large amount of information relating to the
  1511.   configuration and health of the /dev/scc0 SCC port.
  1512.   The sccparam command allows you to change or modify a configuration
  1513.   after you have booted. Its syntax is very similar to the NOS param
  1514.   command, so to set the txtail setting of a device to 100mS you would
  1515.   use:
  1516.  
  1517.        # sccparam /dev/scc0 txtail 0x8
  1518.  
  1519.   6.1.8.  Creating a BPQ ethernet device.
  1520.  
  1521.   Kernel Compile Options:
  1522.  
  1523.        General setup  --->
  1524.            [*] Networking support
  1525.        Network device support  --->
  1526.            [*] Network device support
  1527.            ...
  1528.            [*] Radio network interfaces
  1529.            [*] BPQ Ethernet driver for AX.25
  1530.  
  1531.   Linux supports BPQ Ethernet compatibility. This enables you to run the
  1532.   AX.25 protocol over your Ethernet LAN and to interwork your linux
  1533.   machine with other BPQ machines on the LAN.
  1534.  
  1535.   The BPQ network devices are named `bpq[0-9]'. The `bpq0' device is
  1536.   associated with the `eth0' device, the `bpq1' device with the `eth1'
  1537.   device etc.
  1538.  
  1539.   Configuration is quite straightforward. You firstly must have
  1540.   configured a standard Ethernet device. This means you will have
  1541.   compiled your kernel to support your Ethernet card and tested that
  1542.   this works. Refer to the Ethernet-HOWTO <Ethernet-HOWTO.html> for more
  1543.   information on how to do this.
  1544.  
  1545.   To configure the BPQ support you need to configure the Ethernet device
  1546.   with an AX.25 callsign. The following command will do this for you:
  1547.  
  1548.        # /sbin/ifconfig bpq0 hw ax25 vk2ktj-14 up
  1549.  
  1550.   Again, remember that the callsign you specify should match the entry
  1551.   in the /etc/ax25/axports file that you wish to use for this port.
  1552.  
  1553.   6.1.9.  Configuring the BPQ Node to talk to the Linux AX.25 support.
  1554.  
  1555.   BPQ Ethernet normally uses a multicast address. The Linux
  1556.   implementation does not, and instead it uses the normal Ethernet
  1557.   broadcast address. The NET.CFG file for the BPQ ODI driver should
  1558.   therefore be modifified to look similar to this:
  1559.  
  1560.        LINK SUPPORT
  1561.  
  1562.                MAX STACKS 1
  1563.                MAX BOARDS 1
  1564.  
  1565.        LINK DRIVER E2000                    ; or other MLID to suit your card
  1566.  
  1567.                INT 10                       ;
  1568.                PORT 300                     ; to suit your card
  1569.  
  1570.                FRAME ETHERNET_II
  1571.  
  1572.                PROTOCOL BPQ 8FF ETHERNET_II ; required for BPQ - can change PID
  1573.  
  1574.        BPQPARAMS                            ; optional - only needed if you want
  1575.                                             ; to override the default target addr
  1576.  
  1577.                ETH_ADDR  FF:FF:FF:FF:FF:FF  ; Target address
  1578.  
  1579.   6.2.  Creating the /etc/ax25/axports file.
  1580.  
  1581.   The /etc/ax25/axports is a simple text file that you create with a
  1582.   text editor. The format of the /etc/ax25/axports file is as follows:
  1583.  
  1584.        portname  callsign  baudrate  paclen  window  description
  1585.  
  1586.   where:
  1587.  
  1588.      portname
  1589.         is a text name that you will refer to the port by.
  1590.  
  1591.      callsign
  1592.         is the AX.25 callsign you want to assign to the port.
  1593.  
  1594.      baudrate
  1595.         is the speed at which you wish the port to communicate with your
  1596.         TNC.
  1597.  
  1598.      paclen
  1599.         is the maximum packet length you want to configure the port to
  1600.         use for AX.25 connected mode connections.
  1601.  
  1602.      window
  1603.         is the AX.25 window (K) parameter. This is the same as the
  1604.         MAXFRAME setting of many tnc's.
  1605.  
  1606.      description
  1607.         is a textual description of the port.
  1608.  
  1609.   In my case, mine looks like:
  1610.  
  1611.        radio    VK2KTJ-15       4800        256     2       4800bps 144.800 MHz
  1612.        ether    VK2KTJ-14       10000000    256     2       BPQ/ethernet device
  1613.  
  1614.   Remember, you must assign unique callsign/ssid to each AX.25 port you
  1615.   create.  Create one entry for each AX.25 device you want to use, this
  1616.   includes KISS, Baycom, SCC, PI, PT and SoundModem ports. Each entry
  1617.   here will describe exactly one AX.25 network device. The entries in
  1618.   this file are associated with the network devices by the
  1619.   callsign/ssid. This is at least one good reason for requiring unique
  1620.   callsign/ssid.
  1621.  
  1622.   6.3.  Configuring AX.25 routing.
  1623.  
  1624.   You may wish to configure default digipeaters paths for specific
  1625.   hosts.  This is useful for both normal AX.25 connections and also IP
  1626.   based connections.  The axparms command enables you to do this. Again,
  1627.   the man page offers a complete description, but a simple example might
  1628.   be:
  1629.  
  1630.        # /usr/sbin/axparms -route add radio VK2XLZ VK2SUT
  1631.  
  1632.   This command would set a digipeater entry for VK2XLZ via VK2SUT on the
  1633.   AX.25 port named radio.
  1634.  
  1635.   7.  Configuring an AX.25 interface for TCP/IP.
  1636.  
  1637.   It is very simple to configure an AX.25 port to carry TCP/IP.  If you
  1638.   have KISS interfaces then there are two methods for configuring an IP
  1639.   address. The kissattach command has an option that allows you to do
  1640.   specify an IP address. The more conventional method using the ifconfig
  1641.   command will work on all interface types.
  1642.  
  1643.   So, modifying the previous KISS example:
  1644.  
  1645.        # /usr/sbin/kissattach -i 44.136.8.5 -m 512 /dev/ttyS0 radio
  1646.        # /sbin/route add -net 44.136.8.0 netmask 255.255.255.0 ax0
  1647.        # /sbin/route add default ax0
  1648.  
  1649.   to create the AX.25 interface with an IP address of 44.136.8.5 and an
  1650.   MTU of 512 bytes. You should still use the ifconfig to configure the
  1651.   other parameters if necessary.
  1652.  
  1653.   If you have any other interface type then you use the ifconfig program
  1654.   to configure the ip address and netmask details for the port and add a
  1655.   route via the port, just as you would for any other TCP/IP interface.
  1656.   The following example is for a PI card device, but would work equally
  1657.   well for any other AX.25 network device:
  1658.  
  1659.        # /sbin/ifconfig pi0a 44.136.8.5 netmask 255.255.255.0 up
  1660.        # /sbin/ifconfig pi0a broadcast 44.136.8.255 mtu 512
  1661.        # /sbin/route add -net 44.136.8.0 netmask 255.255.255.0 pi0a
  1662.        # /sbin/route add default pi0a
  1663.  
  1664.   The commands listed above are typical of the sort of configuration
  1665.   many of you would be familiar with if you have used NOS or any of its
  1666.   derivatives or any other TCP/IP software. Note that the default route
  1667.   might not be required in your configuration if you have some other
  1668.   network device configured.
  1669.  
  1670.   To test it out, try a ping or a telnet to a local host.
  1671.  
  1672.        # ping -i 5 44.136.8.58
  1673.  
  1674.   Note the use of the `-i 5' arguments to ping to tell it to send pings
  1675.   every 5 seconds instead of its default of 1 second.
  1676.  
  1677.   8.  Configuring a NetRom port.
  1678.  
  1679.   The NetRom protocol relies on, and uses the AX.25 ports you have
  1680.   created.  The NetRom protocol rides on top of the AX.25 protocol. To
  1681.   configure NetRom on an AX.25 interface you must configure two files.
  1682.   One file describes the Netrom interfaces, and the other file describes
  1683.   which of the AX.25 ports will carry NetRom. You can configure multiple
  1684.   NetRom ports, each with its own callsign and alias, the same procedure
  1685.   applies for each.
  1686.  
  1687.   8.1.  Configuring /etc/ax25/nrports
  1688.  
  1689.   The first is the /etc/ax25/nrports file. This file describes the
  1690.   NetRom ports in much the same way as the /etc/ax25/axports file
  1691.   describes the AX.25 ports. Each NetRom device you wish to create must
  1692.   have an entry in the /etc/ax25/nrports file. Normally a Linux machine
  1693.   would have only one NetRom device configured that would use a number
  1694.   of the AX.25 ports defined. In some situations you might wish a
  1695.   special service such as a BBS to have a seperate NetRom alias and so
  1696.   you would create more than one.
  1697.  
  1698.   This file is formatted as follows:
  1699.  
  1700.        name callsign  alias  paclen   description
  1701.  
  1702.   Where:
  1703.  
  1704.      name
  1705.         is the text name that you wish to refer to the port by.
  1706.  
  1707.      callsign
  1708.         is the callsign that the NetRom traffic from this port will use.
  1709.         Note, this is not that address that users should connect to to
  1710.         get access to a node style interface. (The node program is
  1711.         covered later). This callsign/ssid should be unique and should
  1712.         not appear elsewhere in either of the /etc/ax25/axports or the
  1713.         /etc/ax25/nrports files.
  1714.  
  1715.      alias
  1716.         is the NetRom alias this port will have assigned to it.
  1717.  
  1718.      paclen
  1719.         is the maximum size of NetRom frames transmitted by this port.
  1720.  
  1721.      description
  1722.         is a free text description of the port.
  1723.  
  1724.   An example would look something like the following:
  1725.  
  1726.        netrom  VK2KTJ-9        LINUX   236     Linux Switch Port
  1727.  
  1728.   This example creates a NetRom port known to the rest of the NetRom
  1729.   network as `LINUX:VK2KTJ-9'.
  1730.  
  1731.   This file is used by programs such as the call program.
  1732.  
  1733.   8.2.  Configuring /etc/ax25/nrbroadcast
  1734.  
  1735.   The second file is the /etc/ax25/nrbroadcast file. This file may
  1736.   contain a number of entries. There would normally be one entry for
  1737.   each AX.25 port that you wish to allow NetRom traffic on.
  1738.  
  1739.   This file is formatted as follows:
  1740.  
  1741.        axport min_obs def_qual worst_qual verbose
  1742.  
  1743.   Where:
  1744.  
  1745.      axport
  1746.         is the port name obtained from the /etc/ax25/axports file. If
  1747.         you do not have an entry in /etc/ax25/nrbroadcasts for a port
  1748.         then this means that no NetRom routing will occur and any
  1749.         received NetRom broadcasts will be ignored for that port.
  1750.  
  1751.      min_obs
  1752.         is the minimum obselesence value for the port.
  1753.  
  1754.      def_qual
  1755.         is the default quality for the port.
  1756.  
  1757.      worst_qual
  1758.         is the worst quality value for the port, any routes under this
  1759.         quality will be ignored.
  1760.  
  1761.      verbose
  1762.         is a flag determining whether full NetRom routing broadcasts
  1763.         will occur from this port or only a routing broadcast
  1764.         advertising the node itself.
  1765.  
  1766.   An example would look something like the following:
  1767.  
  1768.        radio    1       200      100         1
  1769.  
  1770.   8.3.  Creating the NetRom Network device
  1771.  
  1772.   When you have the two configuration files completed you must create
  1773.   the NetRom device in much the same way as you did for the AX.25
  1774.   devices.  This time you use the nrattach command. The nrattach works
  1775.   in just the same way as the axattach command except that it creates
  1776.   NetRom network devices called `nr[0-9]'. Again, the first time you use
  1777.   the nrattach command it creates the `nr0' device, the second time it
  1778.   creates the `nr1' network devices etc. To create the network device
  1779.   for the NetRom port we've defined we would use:
  1780.  
  1781.        # nrattach netrom
  1782.  
  1783.   This command would start the NetRom device (nr0) named netrom
  1784.   configured with the details specified in the /etc/ax25/nrports file.
  1785.  
  1786.   8.4.  Starting the NetRom daemon
  1787.  
  1788.   The Linux kernel does all of the NetRom protocol and switching, but
  1789.   does not manage some functions. The NetRom daemon manages the NetRom
  1790.   routing tables and generates the NetRom routing broadcasts. You start
  1791.   NetRom daemon with the command:
  1792.  
  1793.        # /usr/sbin/netromd -i
  1794.  
  1795.   You should soon see the /proc/net/nr_neigh file filling up with
  1796.   information about your NetRom neighbours.
  1797.  
  1798.   Remember to put the /usr/sbin/netromd command in your rc files so that
  1799.   it is started automatically each time you reboot.
  1800.  
  1801.   8.5.  Configuring NetRom routing.
  1802.  
  1803.   You may wish to configure static NetRom routes for specific hosts.
  1804.   The nrparms command enables you to do this. Again, the man page offers
  1805.   a complete description, but a simple example might be:
  1806.  
  1807.        # /usr/sbin/nrparms -nodes VK2XLZ-10 + #MINTO 120 5 radio VK2SUT-9
  1808.  
  1809.   This command would set a NetRom route to #MINTO:VK2XLZ-10 via a
  1810.   neighbour VK2SUT-9 on my AX.25 port called `radio'.
  1811.  
  1812.   You can manually create entries for new neighbours using the nrparms
  1813.   command as well. For example:
  1814.  
  1815.   # /usr/sbin/nrparms -routes radio VK2SUT-9 + 120
  1816.  
  1817.   This command would create VK2SUT-9 as a NetRom neighbour with a
  1818.   quality of 120 and this will be locked and will not be deleted
  1819.   automatically.
  1820.  
  1821.   9.  Configuring a NetRom interface for TCP/IP.
  1822.  
  1823.   Configuring a NetRom interface for TCP/IP is almost identical to
  1824.   configuring an AX.25 interface for TCP/IP.
  1825.  
  1826.   Again you can either specify the ip address and mtu on the nrattach
  1827.   command line, or use the ifconfig and route commands, but you need to
  1828.   manually add arp entries for hosts you wish to route to because there
  1829.   is no mechanism available for your machine to learn what NetRom
  1830.   address it should use to reach a particular IP host.
  1831.  
  1832.   So, to create an nr0 device with an IP address of 44.136.8.5, an mtu
  1833.   of 512 and configured with the details from the /etc/ax25/nrports file
  1834.   for a NetRom port named netrom you would use:
  1835.  
  1836.        # /usr/sbin/nrattach -i 44.136.8.5 -m 512 netrom
  1837.        # route add 44.136.8.5 nr0
  1838.  
  1839.   or you could use something like the following commands manually:
  1840.  
  1841.        # /usr/sbin/nrattach netrom
  1842.        # ifconfig nr0 44.136.8.5 netmask 255.255.255.0 hw netrom VK2KTJ-9
  1843.        # route add 44.136.8.5 nr0
  1844.  
  1845.   Then for each IP host you wish to reach via NetRom you need to set
  1846.   route and arp entries. To reach a destination host with an IP address
  1847.   of 44.136.80.4 at NetRom address BBS:VK3BBS via a NetRom neighbour
  1848.   with callsign VK2SUT-0 you would use commands as follows:
  1849.  
  1850.        # route add 44.136.80.4 nr0
  1851.        # arp -t netrom -s 44.136.80.4 vk2sut-0
  1852.        # nrparms -nodes vk3bbs + BBS 120 6 sl0 vk2sut-0
  1853.  
  1854.   The `120' and `6' arguments to the nrparms command are the NetRom
  1855.   quality and obsolescence count values for the route.
  1856.  
  1857.   10.  Configuring a Rose port.
  1858.  
  1859.   The Rose packet layer protocol is similar to layer three of the X.25
  1860.   specification. The kernel based Rose support is a modified version of
  1861.   the FPAC Rose implementation
  1862.   <http://fpac.lmi.ecp.fr/f1oat/f1oat.html>.
  1863.  
  1864.   The Rose packet layer protocol protocol relies on, and uses the AX.25
  1865.   ports you have created. The Rose protocol rides on top of the AX.25
  1866.   protocol.  To configure Rose you must create a configuration file that
  1867.   describes the Rose ports you want. You can create multiple Rose ports
  1868.   if you wish, the same procedure applies for each.
  1869.  
  1870.   10.1.  Configuring /etc/ax25/rsports
  1871.  
  1872.   The file where you configure your Rose interfaces is the
  1873.   /etc/ax25/rsports file. This file describes the Rose port in much the
  1874.   same way as the /etc/ax25/axports file describes the AX.25 ports.
  1875.  
  1876.   This file is formatted as follows:
  1877.  
  1878.        name  addresss  description
  1879.  
  1880.   Where:
  1881.  
  1882.      name
  1883.         is the text name that you wish to refer to the port by.
  1884.  
  1885.      address
  1886.         is the 10 digit Rose address you wish to assign to this port.
  1887.  
  1888.      description
  1889.         is a free text description of the port.
  1890.  
  1891.   An example would look something like the following:
  1892.  
  1893.        rose  5050294760  Rose Port
  1894.  
  1895.   Note that Rose will use the default callsign/ssid configured on each
  1896.   AX.25 port unless you specify otherwise.
  1897.  
  1898.   To configure a seperate callsign/ssid for Rose to use on each port you
  1899.   use the rsparms command as follows:
  1900.  
  1901.        # /usr/sbin/rsprams -call VK2KTJ-10
  1902.  
  1903.   This example would make Linux listen for and use the callsign/ssid
  1904.   VK2KTJ-10 on all of the configured AX.25 ports for Rose calls.
  1905.  
  1906.   10.2.  Creating the Rose Network device.
  1907.  
  1908.   When you have created the /etc/ax25/rsports file you may create the
  1909.   Rose device in much the same way as you did for the AX.25 devices.
  1910.   This time you use the rsattach command. The rsattach command creates
  1911.   network devices named `rose[0-5]'. The first time you use the rsattach
  1912.   command it create the `rose0' device, the second time it creates the
  1913.   `rose1' device etc. For example:
  1914.  
  1915.        # rsattach rose
  1916.  
  1917.   This command would start the Rose device (rose0) configured with the
  1918.   details specified in the /etc/ax25/rsports file for the entry named
  1919.   `rose'.
  1920.  
  1921.   10.3.  Configuring Rose Routing
  1922.  
  1923.   The Rose protocol currently supports only static routing. The rsparms
  1924.   utility allows you to configure your Rose routing table under Linux.
  1925.  
  1926.   For example:
  1927.  
  1928.        # rsparms -nodes add 5050295502 radio vk2xlz
  1929.  
  1930.   would add a route to Rose node 5050295502 via an AX.25 port named
  1931.   `radio' in your /etc/ax25/axports file to a neighbour with the call¡
  1932.   sign VK2XLZ.
  1933.  
  1934.   You may specify a route with a mask to capture a number of Rose
  1935.   destinations into a single routing entry. The syntax looks like:
  1936.  
  1937.        # rsparms -nodes add 5050295502/4 radio vk2xlz
  1938.  
  1939.   which would be identical to the previous example except that it would
  1940.   match any destination address that matched the first four digits sup¡
  1941.   plied, in this case any address commencing with the digits 5050. An
  1942.   alternate form for this command is:
  1943.  
  1944.        # rsparms -nodes add 5050/4 radio vk2xlz
  1945.  
  1946.   which is probably the less ambiguous form.
  1947.  
  1948.   11.  Making AX.25/NetRom/Rose calls.
  1949.  
  1950.   Now that you have all of your AX.25, NetRom and Rose interfaces
  1951.   configured and active, you should be able to make test calls.
  1952.  
  1953.   The AX25 Utilities package includes a program called `call' which is a
  1954.   splitscreen terminal program for AX.25, NetRom and Rose.
  1955.  
  1956.   A simple AX.25 call would look like:
  1957.  
  1958.        /usr/bin/call radio VK2DAY via VK2SUT
  1959.  
  1960.   A simple NetRom call to a node with an alias of SUNBBS would look
  1961.   like:
  1962.  
  1963.        /usr/bin/call netrom SUNBBS
  1964.  
  1965.   A simple Rose call to HEARD at node 5050882960 would look like:
  1966.  
  1967.        /usr/bin/call rose HEARD 5050882960
  1968.  
  1969.   Note: you must tell call which port you wish to make the call on, as
  1970.   the same destination node might be reachable on any of the ports you
  1971.   have configured.
  1972.  
  1973.   The call program is a linemode terminal program for making AX.25
  1974.   calls. It recognises lines that start with `~' as command lines.  The
  1975.   `~.' command will close the connection.
  1976.  
  1977.   Please refer to the man page in /usr/man for more information.
  1978.  
  1979.   12.  Configuring Linux to accept Packet connections.
  1980.  
  1981.   Linux is a powerful operating system and offers a great deal of
  1982.   flexibility in how it is configured. With this flexibility comes a
  1983.   cost in configuring it to do what you want. When configuring your
  1984.   Linux machine to accept incoming AX.25, NetRom or Rose connections
  1985.   there are a number of questions you need to ask yourself. The most
  1986.   important of which is: "What do I want users to see when they
  1987.   connect?". People are developing neat little applications that may be
  1988.   used to provide services to callers, a simple example is the pms
  1989.   program included in the AX25 utilities, a more complex example is the
  1990.   node program also included in the AX25 utilities. Alternatively you
  1991.   might want to give users a login prompt so that they can make use of a
  1992.   shell account, or you might even have written your own program, such
  1993.   as a customised database or a game, that you want people to connect
  1994.   to. Whatever you choose, you must tell the AX.25 software about this
  1995.   so that it knows what software to run when it accepts an incoming
  1996.   AX.25 connection.
  1997.  
  1998.   The ax25d program is similar to the inetd program commonly used to
  1999.   accept incoming TCP/IP connections on unix machines. It sits and
  2000.   listens for incoming connections, when it detects one it goes away and
  2001.   checks a configuration file to determine what program to run and
  2002.   connect to that connection. Since this the standard tool for accepting
  2003.   incoming AX.25, NetRom and Rose connections I'll describe how to
  2004.   configure it.
  2005.  
  2006.   12.1.  Creating the /etc/ax25/ax25d.conf file.
  2007.  
  2008.   This file is the configuration file for the ax25d AX.25 daemon which
  2009.   handles incoming AX.25, NetRom and Rose connections.
  2010.  
  2011.   The file is a little cryptic looking at first, but you'll soon
  2012.   discover it is very simple in practice, with a small trap for you to
  2013.   be wary of.
  2014.  
  2015.   The general format of the ax25d.conf file is as follows:
  2016.  
  2017.        # This is a comment and is ignored by the ax25d program.
  2018.        [port_name] || <port_name> || {port_name}
  2019.        <peer1>    window T1 T2 T3 idle N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  2020.        <peer2>    window T1 T2 T3 idle N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  2021.        parameters window T1 T2 T3 idle N2 <mode>
  2022.        <peer3>    window T1 T2 T3 idle N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  2023.           ...
  2024.        default    window T1 T2 T3 idle N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  2025.  
  2026.   Where:
  2027.  
  2028.      #  at the start of a line marks a comment and is completely ignored
  2029.         by the ax25d program.
  2030.  
  2031.      <port_name>
  2032.         is the name of the AX.25, NetRom or Rose port as specified in
  2033.         the /etc/ax25/axports, /etc/ax25/nrports and /etc/ax25/rsports
  2034.         files. The name of the port is surrounded by the `[]' brackets
  2035.         if it is an AX.25 port, the `<>' brackets if it is a NetRom
  2036.         port, or the `{}' brackets if it is a Rose port.  There is an
  2037.         alternate form for this field, and that is use prefix the port
  2038.         name with `callsign/ssid via' to indicate that you wish accept
  2039.         calls to the callsign/ssid via this interface. The example
  2040.         should more clearly illustrate this.
  2041.  
  2042.      <peer>
  2043.         is the callsign of the peer node that this particular
  2044.         configuration applies to. If you don't specify an SSID here then
  2045.         any SSID will match.
  2046.  
  2047.      window
  2048.         is the AX.25 Window parameter (K) or MAXFRAME parameter for this
  2049.         configuration.
  2050.  
  2051.      T1 is the Frame retransmission (T1) timer in half second units.
  2052.  
  2053.      T2 is the amount of time the AX.25 software will wait for another
  2054.         incoming frame before preparing a response in 1 second units.
  2055.  
  2056.      T3 is the amount of time of inactivity before the AX.25 software
  2057.         will disconnect the session in 1 second units.
  2058.  
  2059.      idle
  2060.         is the idle timer value in seconds.
  2061.  
  2062.      N2 is the number of consecutive retransmissions that will occur
  2063.         before the connection is closed.
  2064.  
  2065.      <mode>
  2066.         provides a mechanism for determining certain types of general
  2067.         permissions. The modes are enabled or disabled by supplying a
  2068.         combination of characters, each representing a permission. The
  2069.         characters may be in either upper or lower case and must be in a
  2070.         single block with no spaces.
  2071.  
  2072.         u/U
  2073.            UTMP                   - currently unsupported.
  2074.  
  2075.         v/V
  2076.            Validate call          - currently unsupported.
  2077.  
  2078.         q/Q
  2079.            Quiet                  - Don't log connection
  2080.  
  2081.         n/N
  2082.            check NetRom Neighbour - currently unsupported.
  2083.  
  2084.         d/D
  2085.            Disallow Digipeaters   - Connections must be direct, not
  2086.            digipeated.
  2087.  
  2088.         l/L
  2089.            Lockout                - Don't allow connection.
  2090.  
  2091.         */0
  2092.            marker                 - place marker, no mode set.
  2093.  
  2094.      <uid>
  2095.         is the userid that the program to be run to support the
  2096.         connection should be run as.
  2097.  
  2098.      <cmd>
  2099.         is the full pathname of the command to be run, with no arguments
  2100.         specified.
  2101.  
  2102.      <cmd-name>
  2103.         is the text that should appear in a ps as the command name
  2104.         running (normally the same as <cmd> except without the directory
  2105.         path information.
  2106.  
  2107.      <arguments>
  2108.         are the command line argument to be passed to the <:cmd> when it
  2109.         is run. You pass useful information into these arguments by use
  2110.         of the following tokens:
  2111.  
  2112.         %d Name of the port the connection was received on.
  2113.  
  2114.         %U AX.25 callsign of the connected party without the SSID, in
  2115.            uppercase.
  2116.  
  2117.         %u AX.25 callsign of the connected party without the SSID, in
  2118.            lowercase.
  2119.  
  2120.         %S AX.25 callsign of the connected party with the SSID, in
  2121.            uppercase.
  2122.  
  2123.         %s AX.25 callsign of the connected party with the SSID, in
  2124.            lowercase.
  2125.  
  2126.         %P AX.25 callsign of the remote node that the connection came in
  2127.            from without the SSID, in uppercase.
  2128.  
  2129.         %p AX.25 callsign of the remote node that the connection came in
  2130.            from without the SSID, in lowercase.
  2131.  
  2132.         %R AX.25 callsign of the remote node that the connection came in
  2133.            from with the SSID, in uppercase.
  2134.  
  2135.         %r AX.25 callsign of the remote node that the connection came in
  2136.            from with the SSID, in lowercase.
  2137.  
  2138.   You need one section in the above format for each AX.25, NetRom or
  2139.   Rose interface you want to accept incoming AX.25, NetRom or Rose
  2140.   connections on.
  2141.  
  2142.   There are two special lines in the paragraph, one starts with the
  2143.   string `parameters' and the other starts with the string `default'
  2144.   (yes there is a difference). These lines serve special functions.
  2145.  
  2146.   The `default' lines purpose should be obvious, this line acts as a
  2147.   catch-all, so that any incoming connection on the <interface_call>
  2148.   interface that doesn't have a specific rule will match the `default'
  2149.   rule. If you don't have a `default' rule, then any connections not
  2150.   matching any specific rule will be disconnected immediately without
  2151.   notice.
  2152.  
  2153.   The `parameters' line is a little more subtle, and here is the trap I
  2154.   mentioned earlier. In any of the fields for any definition for a peer
  2155.   you can use the `*' character to say `use the default value'. The
  2156.   `parameters' line is what sets those default values. The kernel
  2157.   software itself has some defaults which will be used if you don't
  2158.   specify any using the `parameters' entry. The trap is that the these
  2159.   defaults apply only to those rules below the `parameters' line, not to
  2160.   those above. You may have more than one `parameters' rule per
  2161.   interface definition, and in this way you may create groups of default
  2162.   configurations. It is important to note that the `parameters' rule
  2163.   does not allow you to set the `uid' or `command' fields.
  2164.  
  2165.   12.2.  A simple example ax25d.conf file.
  2166.  
  2167.   Ok, an illustrative example:
  2168.  
  2169.   # ax25d.conf for VK2KTJ - 02/03/97
  2170.   # This configuration uses the AX.25 port defined earlier.
  2171.  
  2172.   # <peer> Win T1  T2  T3  idl N2 <mode> <uid> <exec> <argv[0]>[<args....>]
  2173.  
  2174.   [VK2KTJ-0 via radio]
  2175.   parameters 1    10  *  *  *   *   *
  2176.   VK2XLZ     *     *  *  *  *   *   *    root  /usr/sbin/axspawn axspawn %u +
  2177.   VK2DAY     *     *  *  *  *   *   *    root  /usr/sbin/axspawn axspawn %u +
  2178.   NOCALL     *     *  *  *  *   *   L
  2179.   default    1    10  5 100 180 5   *    root  /usr/sbin/pms pms -a -o vk2ktj
  2180.  
  2181.   [VK2KTJ-1 via radio]
  2182.   default    *     *    *   *   *   0    root /usr/sbin/node node
  2183.  
  2184.   <netrom>
  2185.   parameters 1    10  *  *  *   *   *
  2186.   NOCALL     *     *  *  *  *   *   L
  2187.   default    *     *  *  *  *   *   0        root /usr/sbin/node node
  2188.  
  2189.   {VK2KTJ-0 via rose}
  2190.   parameters 1    10  *  *  *   *   *
  2191.   VK2XLZ     *     *  *  *  *   *   *    root  /usr/sbin/axspawn axspawn %u +
  2192.   VK2DAY     *     *  *  *  *   *   *    root  /usr/sbin/axspawn axspawn %u +
  2193.   NOCALL     *     *  *  *  *   *   L
  2194.   default    1    10  5 100 180 5   *    root  /usr/sbin/pms pms -a -o vk2ktj
  2195.  
  2196.   {VK2KTJ-1 via rose}
  2197.   default    *     *    *   *   *   0    root /usr/sbin/node node radio
  2198.  
  2199.   This example says that anybody attempting to connect to the callsign
  2200.   `VK2KTJ-0' heard on the AX.25 port called `radio' will have the
  2201.   following rules applied:
  2202.  
  2203.   Anyone whose callsign is set to `NOCALL' should be locked out, note
  2204.   the use of mode `L'.
  2205.  
  2206.   The parameters line changes two parameters from the kernel defaults
  2207.   (Window and T1) and will run the /usr/sbin/axspawn program for them.
  2208.   Any copies of /usr/sbin/axspawn run this way will appear as axspawn in
  2209.   a ps listing for convenience. The next two lines provide definitions
  2210.   for two stations who will receive those permissions.
  2211.  
  2212.   The last line in the paragraph is the `catch all' definition that
  2213.   everybody else will get (including VK2XLZ and VK2DAY using any other
  2214.   SSID other than -1).  This definition sets all of the parameters
  2215.   implicitly and will cause the pms program to be run with a command
  2216.   line argument indicating that it is being run for an AX.25 connection,
  2217.   and that the owner callsign is VK2KTJ. (See the `Configuring the PMS'
  2218.   section below for more details).
  2219.  
  2220.   The next configuration accepts calls to VK2KTJ-1 via the radio port.
  2221.   It runs the node program for everybody that connects to it.
  2222.  
  2223.   The next configuration is a NetRom configuration, note the use of the
  2224.   greater-then and less-than braces instead of the square brackets.
  2225.   These denote a NetRom configuration. This configuration is simpler, it
  2226.   simply says that anyone connecting to our NetRom port called `netrom'
  2227.   will have the node program run for them, unless they have a callsign
  2228.   of `NOCALL' in which case they will be locked out.
  2229.  
  2230.   The last two configurations are for incoming Rose connections. The
  2231.   first for people who have placed calls to `vk2ktj-0' and the second
  2232.   for `VK2KTJ-1 at the our Rose node address. These work precisely the
  2233.   same way. Not the use of the curly braces to distinguish the port as a
  2234.   Rose port.
  2235.  
  2236.   This example is a contrived one but I think it illustrates clearly the
  2237.   important features of the syntax of the configuration file. The
  2238.   configuration file is explained fully in the ax25d.conf man page. A
  2239.   more detailed example is included in the ax25-utils package that might
  2240.   be useful to you too.
  2241.  
  2242.   12.3.  Starting ax25d
  2243.  
  2244.   When you have the two configuration files completed you start ax25d
  2245.   with the command:
  2246.  
  2247.        # /usr/sbin/ax25d
  2248.  
  2249.   When this is run people should be able to make AX.25 connections to
  2250.   your Linux machine. Remember to put the ax25d command in your rc files
  2251.   so that it is started automatically when you reboot each time.
  2252.  
  2253.   13.  Configuring the node software.
  2254.  
  2255.   The node software was developed by Tomi Manninen
  2256.   <tomi.manninen@hut.fi> and was based on the original PMS program.  It
  2257.   provides a fairly complete and flexible node capability that is easily
  2258.   configured. It allows users once they are connected to make Telnet,
  2259.   NetRom, Rose, and AX.25 connections out and to obtain various sorts of
  2260.   information such as Finger, Nodes and Heard lists etc. You can
  2261.   configure the node to execute any Linux command you wish fairly
  2262.   simply.
  2263.  
  2264.   The node would normally be invoked from the ax25d program although it
  2265.   is also capable of being invoked from the TCP/IP inetd program to
  2266.   allow users to telnet to your machine and obtain access to it, or by
  2267.   running it from the command line.
  2268.  
  2269.   13.1.  Creating the /etc/ax25/node.conf file.
  2270.  
  2271.   The node.conf file is where the main configuration of the node takes
  2272.   place. It is a simple text file and its format is as follows:
  2273.  
  2274.   # /etc/ax25/node.conf
  2275.   # configuration file for the node(8) program.
  2276.   #
  2277.   # Lines beginning with '#' are comments and are ignored.
  2278.  
  2279.   # Hostname
  2280.   # Specifies the hostname of the node machine
  2281.   hostname        radio.gw.vk2ktj.ampr.org
  2282.  
  2283.   # Local Network
  2284.   # allows you to specify what is consider 'local' for the
  2285.   # purposes of permission checking using nodes.perms.
  2286.   localnet        44.136.8.96/29
  2287.  
  2288.   # Hide Ports
  2289.   # If specified allows you to make ports invisible to users. The
  2290.   # listed ports will not be listed by the (P)orts command.
  2291.   hiddenports     rose netrom
  2292.  
  2293.   # Node Identification.
  2294.   # this will appear in the node prompt
  2295.   NodeId          LINUX:VK2KTJ-9
  2296.  
  2297.   # NetRom port
  2298.   # This is the name of the netrom port that will be used for
  2299.   # outgoing NetRom connections from the node.
  2300.   NrPort          netrom
  2301.  
  2302.   # Node Idle Timeout
  2303.   # Specifies the idle time for connections to this node in seconds.
  2304.   idletimout      1800
  2305.  
  2306.   # Connection Idle Timeout
  2307.   # Specifies the idle timer for connections made via this node in
  2308.   # seconds.
  2309.   conntimeout     1800
  2310.  
  2311.   # Reconnect
  2312.   # Specifies whether users should be reconnected to the node
  2313.   # when their remote connections disconnect, or whether they
  2314.   # should be disconnected complete.
  2315.   reconnect       on
  2316.  
  2317.   # Command Aliases
  2318.   # Provide a way of making complex node commands simple.
  2319.   alias           CONV    "telnet vk1xwt.ampr.org 3600"
  2320.   alias           BBS     "connect radio vk2xsb"
  2321.  
  2322.   # Externam Command Aliases
  2323.   # Provide a means of executing external commands under the node.
  2324.   # extcmd <cmdname> <flag> <userid> <command>
  2325.   # Flag == 1 is the only implemented function.
  2326.   # <command> is formatted as per ax25d.conf
  2327.   extcmd          PMS     1       root    /usr/sbin/pms pms -u %U -o VK2KTJ
  2328.  
  2329.   # Logging
  2330.   # Set logging to the system log. 3 is the noisiest, 0 is disabled.
  2331.   loglevel        3
  2332.  
  2333.   # The escape character
  2334.   # 20 = (Control-T)
  2335.   EscapeChar      20
  2336.  
  2337.   13.2.  Creating the /etc/ax25/node.perms file.
  2338.  
  2339.   The node allows you to assign permissions to users. These permissions
  2340.   allow you to determine which users should be allowed to make use of
  2341.   options such as the (T)elnet, and (C)onnect commands, for example, and
  2342.   which shouldn't. The node.perms file is where this information is
  2343.   stored and contains five key fields. For all fields an asterisk `*'
  2344.   character matches anything. This is useful for building default rules.
  2345.  
  2346.      user
  2347.         The first field is the callsign or user to which the permissions
  2348.         should apply.  Any SSID value is ignored, so you should just
  2349.         place the base callsign here.
  2350.  
  2351.      method
  2352.         Each protocol or access method is also given permissions. For
  2353.         example you might allow users who have connected via AX.25 or
  2354.         NetRom to use the (C)onnect option, but prevent others, such as
  2355.         those who are telnet connected from a non-local node from having
  2356.         access to it. The second field therefore allows you to select
  2357.         which access method this permissions rule should apply to.  The
  2358.         access methods allowed are:
  2359.  
  2360.           method  description
  2361.           ------  -----------------------------------------------------------
  2362.           ampr    User is telnet connected from an amprnet address (44.0.0.0)
  2363.           ax25    User connected by AX.25
  2364.           host    User started node from command line
  2365.           inet    user is telnet connected from a non-loca, non-ampr address.
  2366.           local   User is telnet connected from a 'local' host
  2367.           netrom  User connected by NetRom
  2368.           rose    User connected by Rose
  2369.           *       User connected by any means.
  2370.  
  2371.      port
  2372.         For AX.25 users you can control permissions on a port by port
  2373.         basis too if you choose. This allows you to determine what AX.25
  2374.         are allowed to do based on which of your ports they have
  2375.         connected to. The third field contains the port name if you are
  2376.         using this facility. This is useful only for AX.25 connections.
  2377.  
  2378.      password
  2379.         You may optionally configure the node so that it prompts users
  2380.         to enter a password when they connect. This might be useful to
  2381.         help protect specially configured users who have high authority
  2382.         levels. If the fourth field is set then its value will be the
  2383.         password that will be accepted.
  2384.  
  2385.      permissions
  2386.         The permissions field is the final field in each entry in the
  2387.         file.  The permissions field is coded as a bit field, with each
  2388.         facility having a bit value which if set allows the option to be
  2389.         used and if not set prevents the facility being used. The list
  2390.         of controllable facilities and their corresponding bit values
  2391.         are:
  2392.  
  2393.      value   description
  2394.      -----   -------------------------------------------------
  2395.       1      Login allowed.
  2396.       2      AX25 (C)onnects allowed.
  2397.       4      NetRom (C)onnects allowed.
  2398.       8      (T)elnet to local hosts allowed.
  2399.       16     (T)elnet to amprnet (44.0.0.0) hosts allowed.
  2400.       32     (T)elnet to non-local, non-amprnet hosts allowed.
  2401.       64     Hidden ports allowed for AX.25 (C)onnects.
  2402.       128    Rose (C)onnects allowed.
  2403.  
  2404.      To code the permissions value for a rule, simply take each of the
  2405.      permissions you want that user to have and add their values
  2406.      together. The resulting number is what you place in field five.
  2407.  
  2408.   A sample nodes.perms might look like:
  2409.  
  2410.        # /etc/ax25/node.perms
  2411.        #
  2412.        # The node operator is VK2KTJ, has a password of 'secret' and
  2413.        # is allowed all permissions by all connection methods
  2414.        vk2ktj  *       *       secret  255
  2415.  
  2416.        # The following users are banned from connecting
  2417.        NOCALL  *       *       *       0
  2418.        PK232   *       *       *       0
  2419.        PMS     *       *       *       0
  2420.  
  2421.        # INET users are banned from connecting.
  2422.        *       inet    *       *       0
  2423.  
  2424.        # AX.25, NetRom, Local, Host and AMPR users may (C)onnect and (T)elnet
  2425.        # to local and ampr hosts but not to other IP addresses.
  2426.        *       ax25    *       *       159
  2427.        *       netrom  *       *       159
  2428.        *       local   *       *       159
  2429.        *       host    *       *       159
  2430.        *       ampr    *       *       159
  2431.  
  2432.   13.3.  Configuring node to run from ax25d
  2433.  
  2434.   The node program would normally be run by the ax25d program.  To do
  2435.   this you need to add appropriate rules to the /etc/ax25/ax25d.conf
  2436.   file. In my configuration I wanted users to have a choice of either
  2437.   connecting to the node or connecting to other services. ax25d allows
  2438.   you to do this by cleverly creating creating port aliases. For
  2439.   example, given the ax25d configuration presented above, I want to
  2440.   configure node so that all users who connect to VK2KTJ-1 are given the
  2441.   node. To do this I add the following to my /etc/ax25/ax25d.conf file:
  2442.  
  2443.        [vk2ktj-1 via radio]
  2444.        default    *     *    *   *   *   0    root /usr/sbin/node node
  2445.  
  2446.   This says that the Linux kernel code will answer any connection
  2447.   requests for the callsign `VK2KTJ-1' heard on the AX.25 port named
  2448.   `radio', and will cause the node program to be run.
  2449.  
  2450.   13.4.  Configuring node to run from inetd
  2451.  
  2452.   If you want users to be able to telnet a port on your machine and
  2453.   obtain access to the node you can go this fairly easily. The first
  2454.   thing to decide is what port users should connect to. In this example
  2455.   I've arbitrarily chosen port 4000, though Tomi gives details on how
  2456.   you could replace the normal telnet daemon with the node in his
  2457.   documentation.
  2458.  
  2459.   You need to modify two files.
  2460.  
  2461.   To /etc/services you should add:
  2462.  
  2463.        node    3694/tcp        #OH2BNS's node software
  2464.  
  2465.   and to /etc/inetd.conf you should add:
  2466.  
  2467.        node    stream  tcp     nowait  root    /usr/sbin/node node
  2468.  
  2469.   When this is done, and you have restarted the inetd program any user
  2470.   who telnet connects to port 3694 of your machine will be prompted to
  2471.   login and if configured, their password and then they will be con¡
  2472.   nected to the node.
  2473.  
  2474.   14.  Configuring axspawn.
  2475.  
  2476.   The axspawn program is a simple program that allows AX.25 stations who
  2477.   connect to be logged in to your machine. It may be invoked from the
  2478.   ax25d program as described above in a manner similar to the node
  2479.   program. To allow a user to log in to your machine you should add a
  2480.   line similar to the following into your /etc/ax25/ax25d.conf file:
  2481.  
  2482.        default * * * * * 1 root /usr/sbin/axspawn axspawn %u
  2483.  
  2484.   If the line ends in the + character then the connecting user must hit
  2485.   return before they will be allowed to login. The default is to not
  2486.   wait.  Any individual host configurations that follow this line will
  2487.   have the axspawn program run when they connect. When axspawn is run it
  2488.   first checks that the command line argument it is supplied is a legal
  2489.   callsign, strips the SSID, then it checks that /etc/passwd file to see
  2490.   if that user has an account configured. If there is an account, and
  2491.   the password is either "" (null) or + then the user is logged in, if
  2492.   there is anything in the password field the user is prompted to enter
  2493.   a password. If there is not an existing account in the /etc/passwd
  2494.   file then axspawn may be configured to automatically create one.
  2495.  
  2496.   14.1.  Creating the /etc/ax25/axspawn.conf file.
  2497.  
  2498.   You can alter the behaviour of axspawn in various ways by use of the
  2499.   /etc/ax25/axspawn.conf file. This file is formatted as follows:
  2500.  
  2501.        # /etc/ax25/axspawn.conf
  2502.        #
  2503.        # allow automatic creation of user accounts
  2504.        create    yes
  2505.        #
  2506.        # guest user if above is 'no' or everything else fails. Disable with "no"
  2507.        guest     no
  2508.        #
  2509.        # group id or name for autoaccount
  2510.        group     ax25
  2511.        #
  2512.        # first user id to use
  2513.        first_uid 2001
  2514.        #
  2515.        # maximum user id
  2516.        max_uid   3000
  2517.        #
  2518.        # where to add the home directory for the new users
  2519.        home      /home/ax25
  2520.        #
  2521.        # user shell
  2522.        shell     /bin/bash
  2523.        #
  2524.        # bind user id to callsign for outgoing connects.
  2525.        associate yes
  2526.  
  2527.   The eight configurable characteristics of axspawn are as follows:
  2528.  
  2529.      #  indicates a comment.
  2530.  
  2531.      create
  2532.         if this field is set to yes then axspawn will attempt to
  2533.         automatically create a user account for any user who connects
  2534.         and does not already have an entry in the /etc/passwd file.
  2535.  
  2536.      guest
  2537.         this field names the login name of the account that will be used
  2538.         for people who connect who do not already have accounts if
  2539.         create is set to no. This is usually ax25 or guest.
  2540.  
  2541.      group
  2542.         this field names the group name that will be used for any users
  2543.         who connect and do not already have an entry in the /etc/passwd
  2544.         file.
  2545.  
  2546.      first_uid
  2547.         this is the number of the first userid that will be
  2548.         automatically created for new users.
  2549.  
  2550.      max_uid
  2551.         this is the maximum number that will be used for the userid of
  2552.         new users.
  2553.  
  2554.      home
  2555.         this is the home (login) directory of new users.
  2556.  
  2557.      shell
  2558.         this is the login shell of any new users.
  2559.  
  2560.      associate
  2561.         this flag indicates whether outgoing AX.25 connections made by
  2562.         this user after they login will use their own callsign, or your
  2563.         stations callsign.
  2564.  
  2565.   15.  Configuring the pms
  2566.  
  2567.   The pms program is an implementation of a simple personal message
  2568.   system. It was originally written by Alan Cox. Dave Brown, N2RJT,
  2569.   <dcb@vectorbd.com> has taken on further development of it.  At present
  2570.   it is still very simple, supporting only the ability to send mail to
  2571.   the owner of the system and to obtain some limited system information
  2572.   but Dave is working to expand its capability to make it more useful.
  2573.  
  2574.   After that is done there are a couple of simple files that you should
  2575.   create that give users some information about the system and then you
  2576.   need to add appropriate entries into the ax25d.conf file so that
  2577.   connected users are presented with the PMS.
  2578.  
  2579.   15.1.  Create the /etc/ax25/pms.motd file.
  2580.  
  2581.   The /etc/ax25/pms.motd file contains the `message of the day' that
  2582.   users will be presented with after they connect and receive the usual
  2583.   BBS id header. The file is a simple text file, any text you include in
  2584.   this file will be sent to users.
  2585.  
  2586.   15.2.  Create the /etc/ax25/pms.info file.
  2587.  
  2588.   The /etc/ax25/pms.info file is also a simple text file in which you
  2589.   would put more detailed information about your station or
  2590.   configuration.  This file is presented to users in response to their
  2591.   issuing of the Info command from the PMS> prompt.
  2592.  
  2593.   15.3.  Associate AX.25 callsigns with system users.
  2594.  
  2595.   When a connected user sends mail to an AX.25 callsign, the pms expects
  2596.   that callsign to be mapped, or associated with a real system user on
  2597.   your machine. This is described in a section of its own.
  2598.  
  2599.   15.4.  Add the PMS to the /etc/ax25/ax25d.conf file.
  2600.  
  2601.   Adding the pms to your ax25d.conf file is very simple.  There is one
  2602.   small thing you need to think about though. Dave has added command
  2603.   line arguments to the PMS to allow it to handle a number of different
  2604.   text end-of-line conventions. AX.25 and NetRom by convention expect
  2605.   the end-of-line to be carriage return, linefeed while the standard
  2606.   unix end-of-line is just newline. So, for example, if you wanted to
  2607.   add an entry that meant that the default action for a connection
  2608.   received on an AX.25 port is to start the PMS then you would add a
  2609.   line that looked something like:
  2610.  
  2611.        default  1  10 5 100 5   0    root  /usr/sbin/pms pms -a -o vk2ktj
  2612.  
  2613.   This simply runs the pms program, telling it that it is an AX.25
  2614.   connection it is connected to and that the PMS owner is vk2ktj.  Check
  2615.   the man page for what you should specify for other connection methods.
  2616.  
  2617.   15.5.  Test the PMS.
  2618.  
  2619.   To test the PMS, you can try the following command from the command
  2620.   line:
  2621.  
  2622.   # /usr/sbin/pms -u vk2ktj -o vk2ktj
  2623.  
  2624.   Substitute your own callsign for mine and this will run the pms,
  2625.   telling it that it is to use the unix end-of-line convention, and that
  2626.   user logging in is vk2ktj. You can do all the things connected users
  2627.   can.
  2628.  
  2629.   Additionally you might try getting some other node to connect to you
  2630.   to confirm that your ax25d.conf configuration works.
  2631.  
  2632.   16.  Configuring the user_call programs.
  2633.  
  2634.   The `user_call' programs are really called: ax25_call and netrom_call.
  2635.   They are very simple programs designed to be called from ax25d to
  2636.   automate network connections to remote hosts. They may of course be
  2637.   called from a number of other places such as shell scripts or other
  2638.   daemons such as the node program.
  2639.  
  2640.   They are like a very simple call program. They don't do any meddling
  2641.   with the data at all, so the end of line handling you'll have to worry
  2642.   about yourself.
  2643.  
  2644.   Let's start with an example of how you might use them. Imagine you
  2645.   have a small network at home and that you have one linux machine
  2646.   acting as your Linux radio gateway and another machine, lets say a BPQ
  2647.   node connected to it via an ethernet connection.
  2648.  
  2649.   Normally if you wanted radio users to be able to connect to the BPQ
  2650.   node they would either have to digipeat through your linux node, or
  2651.   connect to the node program on your linux node and then connect from
  2652.   it.  The ax25_call program can simplify this if it is called from the
  2653.   ax25d program.
  2654.  
  2655.   Imagine the BPQ node has the callsign VK2KTJ-9 and that the linux
  2656.   machine has the AX.25/ethernet port named `bpq'. Let us also imagine
  2657.   the Linux gateway machine has a radio port called `radio'.
  2658.  
  2659.   An entry in the /etc/ax25/ax25d.conf that looked like:
  2660.  
  2661.        [VK2KTJ-1 via radio]
  2662.        default    * * * *   *   *  *
  2663.                        root /usr/sbin/ax25_call ax25_call bpq %u vk2ktj-9
  2664.  
  2665.   would enable users to connect direct to `VK2KTJ-1' which would actu¡
  2666.   ally be the Linux ax25d daemon and then be automatically switched to
  2667.   an AX.25 connection to `VK2KTJ-9' via the `bpq' interface.
  2668.  
  2669.   There are all sorts of other possible configurations that you might
  2670.   try.  The `netrom_call' and `rose_call' utilities work in similar
  2671.   ways. One amateur has used this utility to make connections to a
  2672.   remote BBS easier. Normally the users would have to manually enter a
  2673.   long connection string to make the call so he created an entry that
  2674.   made the BBS appear as though it were on the local network by having
  2675.   his ax25d proxy the connection to the remote machine.
  2676.  
  2677.   17.  Configuring the Rose Uplink and Downlink commands
  2678.  
  2679.   If you are familiar with the ROM based Rose implementation you will be
  2680.   familiar with the method by which AX.25 users make calls across a Rose
  2681.   network. If a users local Rose node has the callsign VK2KTJ-5 and the
  2682.   AX.25 user wants to connect to VK5XXX at remote Rose node 5050882960
  2683.   then they would issue the command:
  2684.  
  2685.        c vk5xxx v vk2ktj-5 5050 882960
  2686.  
  2687.   At the remote node, VK5XXX would see an incoming connection with the
  2688.   local AX.25 users callsign and being digipeated via the remote Rose
  2689.   nodes callsign.
  2690.  
  2691.   The Linux Rose implementation does not support this capability in the
  2692.   kernel, but there are two application programs called rsuplnk and
  2693.   rsdwnlnk which perform this function.
  2694.  
  2695.   17.1.  Configuring a Rose downlink
  2696.  
  2697.   To configure your Linux machine to accept a Rose connection and
  2698.   establish an AX.25 connection to any destination callsign that is not
  2699.   being listened for on your machine you need to add an entry to your
  2700.   /etc/ax25/ax25d.conf file. Normally you would configure this entry to
  2701.   be the default behaviour for incoming Rose connections. For example
  2702.   you might have Rose listeners operating for destinations like NODE-0
  2703.   or HEARD-0 that you wish to handle locally, but for all other
  2704.   destination calls you may want to pass them to the rsdwnlink command
  2705.   and assume they are AX.25 users.
  2706.  
  2707.   A typical configuration would look like:
  2708.  
  2709.        #
  2710.        {* via rose}
  2711.        NOCALL   * * * * * *  L
  2712.        default  * * * * * *  - root  /usr/sbin/rsdwnlnk rsdwnlnk 4800 vk2ktj-5
  2713.        #
  2714.  
  2715.   With this configuration any user who established a Rose connection to
  2716.   your Linux nodes address with a destination call of something that you
  2717.   were not specifically listening for would be converted into an AX.25
  2718.   connection on the AX.25 port named 4800 with a digipeater path of
  2719.   VK2KTJ-5.
  2720.  
  2721.   17.2.  Configuring a Rose uplink
  2722.  
  2723.   To configure your Linux machine to accept AX.25 connections in the
  2724.   same way that a ROM Rose node would you must add an entry into your
  2725.   /etc/ax25/ax25d.conf file that looks similar to the following:
  2726.  
  2727.        #
  2728.        [VK2KTJ-5* via 4800]
  2729.        NOCALL   * * * * * *  L
  2730.        default  * * * * * *  - root  /usr/sbin/rsuplnk rsuplnk rose
  2731.        #
  2732.  
  2733.   Note the special syntax for the local callsign. The `*' character
  2734.   indicates that the application should be invoked if the callsign is
  2735.   heard in the digipeater path of a connection.
  2736.  
  2737.   This configuration would allow an AX.25 user to establish Rose calls
  2738.   using the example connect sequence presented in the introduction.
  2739.   Anybody attempting to digipeat via VK2KTJ-5 on the AX.25 port named
  2740.   4800 would be handled by the rsuplnk command.
  2741.  
  2742.   18.  Associating AX.25 callsigns with Linux users.
  2743.  
  2744.   There are a number of situations where it is highly desirable to
  2745.   associate a callsign with a linux user account. One example might be
  2746.   where a number of amateur radio operators share the same linux machine
  2747.   and wish to use their own callsign when making calls. Another is the
  2748.   case of PMS users wanting to talk to a particular user on your
  2749.   machine.
  2750.  
  2751.   The AX.25 software provides a means of managing this association of
  2752.   linux user account names with callsigns. We've mentioned it once
  2753.   already in the PMS section, but I'm spelling it out here to be sure
  2754.   you don't miss it.
  2755.  
  2756.   You make the association with the axparms command. An example looks
  2757.   like:
  2758.  
  2759.        # axparms -assoc vk2ktj terry
  2760.  
  2761.   This command associates that AX.25 callsign vk2ktj with the user terry
  2762.   on the machine. So, for example, any mail for vk2ktj on the pms will
  2763.   be sent to Linux account terry.
  2764.  
  2765.   Remember to put these associations into your rc file so that they are
  2766.   available each time your reboot.
  2767.  
  2768.   Note you should never associate a callsign with the root account as
  2769.   this can cause configuration problems in other programs.
  2770.  
  2771.   19.  The /proc/ file system entries.
  2772.  
  2773.   The /proc filesystem contains a number of files specifically related
  2774.   to the AX25 and NetRom kernel software. These files are normally used
  2775.   by the AX52 utilities, but they are plainly formatted so you may be
  2776.   interested in reading them. The format is fairly easily understood so
  2777.   I don't think much explanation will be necessary.
  2778.  
  2779.      /proc/net/arp
  2780.         contains the list of Address Resolution Protocol mappings of IP
  2781.         addresses to MAC layer protocol addresses. These can can AX.25,
  2782.         ethernet or some other MAC layer protocol.
  2783.  
  2784.      /proc/net/ax25
  2785.         contains a list of AX.25 sockets opened. These might be
  2786.         listening for a connection, or active sessions.
  2787.  
  2788.      /proc/net/ax25_bpqether
  2789.         contains the AX25 over ethernet BPQ style callsign mappings.
  2790.  
  2791.      /proc/net/ax25_calls
  2792.         contains the linux userid to callsign mappings set my the
  2793.         axparms -assoc command.
  2794.  
  2795.      /proc/net/ax25_route
  2796.         contains AX.25 digipeater path information.
  2797.  
  2798.      /proc/net/nr
  2799.         contains a list of NetRom sockets opened. These might be
  2800.         listening for a connection, or active sessions.
  2801.  
  2802.      /proc/net/nr_neigh
  2803.         contains information about the NetRom neighbours known to the
  2804.         NetRom software.
  2805.  
  2806.      /proc/net/nr_nodes
  2807.         contains information about the NetRom nodes known to the NetRom
  2808.         software.
  2809.  
  2810.      /proc/net/rose
  2811.         contains a list of Rose sockets opened. These might be listening
  2812.         for a connection, or active sessions.
  2813.  
  2814.      /proc/net/rose_nodes
  2815.         contains a mapping of Rose destinations to Rose neighbours.
  2816.  
  2817.      /proc/net/rose_neigh
  2818.         contains a list of known Rose neighbours.
  2819.  
  2820.      /proc/net/rose_routes
  2821.         contains a list of all established Rose connections.
  2822.  
  2823.   20.  AX.25, NetRom, Rose network programming.
  2824.  
  2825.   Probably the biggest advantage of using the kernel based
  2826.   implementations of the amateur packet radio protocols is the ease with
  2827.   which you can develop applications and programs to use them.
  2828.  
  2829.   While the subject of Unix Network Programming is outside the scope of
  2830.   this document I will describe the elementary details of how you can
  2831.   make use of the AX.25, NetRom and Rose protocols within your software.
  2832.  
  2833.   20.1.  The address families.
  2834.  
  2835.   Network programming for AX.25, NetRom and Rose is quite similar to
  2836.   programming for TCP/IP under Linux. The major differences being the
  2837.   address families used, and the address structures that need to be
  2838.   mangled into place.
  2839.  
  2840.   The address family names for AX.25, NetRom and Rose are AF_AX25,
  2841.   AF_NETROM and AF_ROSE respectively.
  2842.  
  2843.   20.2.  The header files.
  2844.  
  2845.   You must always include the `ax25.h' header file, and also the
  2846.   `netrom.h' or `rose.h' header files if you are dealing with those
  2847.   protocols. Simple top level skeletons would look something like the
  2848.   following:
  2849.  
  2850.   For AX.25:
  2851.  
  2852.        #include <ax25.h>
  2853.        int s, addrlen = sizeof(struct full_sockaddr_ax25);
  2854.        struct full_sockaddr_ax25 sockaddr;
  2855.        sockaddr.fsa_ax25.sax25_family = AF_AX25
  2856.  
  2857.   For NetRom:
  2858.  
  2859.        #include <ax25.h>
  2860.        #include <netrom.h>
  2861.        int s, addrlen = sizeof(struct full_sockaddr_ax25);
  2862.        struct full_sockaddr_ax25 sockaddr;
  2863.        sockaddr.fsa_ax25.sax25_family = AF_NETROM;
  2864.  
  2865.   For Rose:
  2866.  
  2867.        #include <ax25.h>
  2868.        #include <rose.h>
  2869.        int s, addrlen = sizeof(struct sockaddr_rose);
  2870.        struct sockaddr_rose sockaddr;
  2871.        sockaddr.srose_family = AF_ROSE;
  2872.  
  2873.   20.3.  Callsign mangling and examples.
  2874.  
  2875.   There are routines within the lib/ax25.a library built in the AX25
  2876.   utilities package that manage the callsign conversions for you. You
  2877.   can write your own of course if you wish.
  2878.  
  2879.   The user_call utilities are excellent examples from which to work. The
  2880.   source code for them is included in the AX25 utilities package.  If
  2881.   you spend a little time working with those you will soon see that
  2882.   ninety percent of the work is involved in just getting ready to open
  2883.   the socket. Actually making the connection is easy, the preparation
  2884.   takes time.
  2885.  
  2886.   The example are simple enough to not be very confusing. If you have
  2887.   any questions, you should feel to direct them to the linux-hams
  2888.   mailing list and someone there will be sure to help you.
  2889.  
  2890.   21.  Some sample configurations.
  2891.  
  2892.   Following are examples of the most common types of configurations.
  2893.   These are guides only as there are as many ways of configuring your
  2894.   network as there are networks to configure, but they may give you a
  2895.   start.
  2896.  
  2897.   21.1.  Small Ethernet LAN with Linux as a router to Radio LAN
  2898.  
  2899.   Many of you may have small local area networks at home and want to
  2900.   connect the machines on that network to your local radio LAN. This is
  2901.   the type of configuration I use at home. I arranged to have a suitable
  2902.   block of addresses allocated to me that I could capture in a single
  2903.   route for convenience and I use these on my Ethernet LAN. Your local
  2904.   IP coordinator will assist you in doing this if you want to try it as
  2905.   well. The addresses for the Ethernet LAN form a subset of the radio
  2906.   LAN addresses. The following configuration is the actual one for my
  2907.   linux router on my network at home:
  2908.  
  2909.                                                  .      .   .    .    . .
  2910.          ---                                .
  2911.           | Network       /---------\     .    Network
  2912.           | 44.136.8.96/29|         |    .     44.136.8/24        \ | /
  2913.           |               | Linux   |   .                          \|/
  2914.           |               |         |  .                            |
  2915.           |          eth0 | Router  |  .  /-----\    /----------\   |
  2916.           |---------------|         |-----| TNC |----| Radio    |---/
  2917.           |   44.136.8.97 |  and    |  .  \-----/    \----------/
  2918.           |               |         | sl0
  2919.           |               | Server  | 44.136.8.5
  2920.           |               |         |    .
  2921.           |               |         |     .
  2922.           |               \_________/       .
  2923.          ---                                     .      .   .    .    . .
  2924.  
  2925.   #!/bin/sh
  2926.   # /etc/rc.net
  2927.   # This configuration provides one KISS based AX.25 port and one
  2928.   # Ethernet device.
  2929.  
  2930.   echo "/etc/rc.net"
  2931.   echo "  Configuring:"
  2932.  
  2933.   echo -n "    loopback:"
  2934.   /sbin/ifconfig lo 127.0.0.1
  2935.   /sbin/route add 127.0.0.1
  2936.   echo " done."
  2937.  
  2938.   echo -n "    ethernet:"
  2939.   /sbin/ifconfig eth0 44.136.8.97 netmask 255.255.255.248 \
  2940.                   broadcast 44.136.8.103 up
  2941.   /sbin/route add 44.136.8.97 eth0
  2942.   /sbin/route add -net 44.136.8.96 netmask 255.255.255.248 eth0
  2943.   echo " done."
  2944.  
  2945.   echo -n "    AX.25: "
  2946.   kissattach -i 44.136.8.5 -m 512 /dev/ttyS1 4800
  2947.   ifconfig sl0 netmask 255.255.255.0 broadcast 44.136.8.255
  2948.   route add -host 44.136.8.5 sl0
  2949.   route add -net 44.136.8.0 window 1024 sl0
  2950.  
  2951.   echo -n "    Netrom: "
  2952.   nrattach -i 44.136.8.5 netrom
  2953.  
  2954.   echo "  Routing:"
  2955.   /sbin/route add default gw 44.136.8.68 window 1024 sl0
  2956.   echo "    default route."
  2957.   echo done.
  2958.  
  2959.   # end
  2960.  
  2961.   /etc/ax25/axports
  2962.  
  2963.        # name  callsign        speed   paclen  window  description
  2964.        4800    VK2KTJ-0        4800    256     2       144.800 MHz
  2965.  
  2966.   /etc/ax25/nrports
  2967.  
  2968.        # name  callsign        alias   paclen  description
  2969.        netrom  VK2KTJ-9        LINUX   235     Linux Switch Port
  2970.  
  2971.   /etc/ax25/nrbroadcast
  2972.  
  2973.        # ax25_name     min_obs def_qual        worst_qual      verbose
  2974.        4800            1       120             10              1
  2975.  
  2976.   ╖  You must have IP_FORWARDING enabled in your kernel.
  2977.  
  2978.   ╖  The AX.25 configuration files are pretty much those used as
  2979.      examples in the earlier sections, refer to those where necessary.
  2980.  
  2981.   ╖  I've chosen to use an IP address for my radio port that is not
  2982.      within my home network block. I needn't have done so, I could have
  2983.      easily used 44.136.8.97 for that port too.
  2984.  
  2985.   ╖  44.136.8.68 is my local IPIP encapsulated gateway and hence is
  2986.      where I point my default route.
  2987.  
  2988.   ╖  Each of the machines on my Ethernet network have a route:
  2989.  
  2990.        route add -net 44.0.0.0 netmask 255.0.0.0 \
  2991.                gw 44.136.8.97 window 512 mss 512 eth0
  2992.  
  2993.   The use of the mss and window parameters means that I can get optimum
  2994.   performance from both local Ethernet and radio based connections.
  2995.  
  2996.   ╖  I also run my smail, http, ftp and other daemons on the router
  2997.      machine so that it needs to be the only machine to provide others
  2998.      with facilities.
  2999.  
  3000.   ╖  The router machine is a lowly 386DX20 with a 20Mb harddrive and a
  3001.      very minimal linux configuration.
  3002.  
  3003.   21.2.  IPIP encapsulated gateway configuration.
  3004.  
  3005.   Linux is now very commonly used for TCP/IP encapsulated gateways
  3006.   around the world. The new tunnel driver supports multiple encapsulated
  3007.   routes and makes the older ipip daemon obsolete.
  3008.  
  3009.   A typical configuration would look similar to the following.
  3010.  
  3011.                                                  .      .   .    .    . .
  3012.          ---                                .
  3013.           | Network       /---------\     .    Network
  3014.           | 154.27.3/24   |         |    .     44.136.16/24       \ | /
  3015.           |               | Linux   |   .                          \|/
  3016.           |               |         |  .                            |
  3017.           |          eth0 | IPIP    |  .  /-----\    /----------\   |
  3018.        ---|---------------|         |-----| TNC |----| Radio    |---/
  3019.           |   154.27.3.20 | Gateway |  .  \-----/    \----------/
  3020.           |               |         | sl0
  3021.           |               |         | 44.136.16.1
  3022.           |               |         |    .
  3023.           |               |         |     .
  3024.           |               \_________/       .
  3025.          ---                                     .      .   .    .    . .
  3026.  
  3027.   The configuration files of interest are:
  3028.  
  3029.   # /etc/rc.net
  3030.   # This file is a simple configuration that provides one KISS AX.25
  3031.   # radio port, one Ethernet device, and utilises the kernel tunnel driver
  3032.   # to perform the IPIP encapsulation/decapsulation
  3033.   #
  3034.   echo "/etc/rc.net"
  3035.   echo "  Configuring:"
  3036.   #
  3037.   echo -n "    loopback:"
  3038.   /sbin/ifconfig lo 127.0.0.1
  3039.   /sbin/route add 127.0.0.1
  3040.   echo " done."
  3041.   #
  3042.   echo -n "    ethernet:"
  3043.   /sbin/ifconfig eth0 154.27.3.20 netmask 255.255.255.0 \
  3044.                   broadcast 154.27.3.255 up
  3045.   /sbin/route add 154.27.3.20 eth0
  3046.   /sbin/route add -net 154.27.3.0 netmask 255.255.255.0 eth0
  3047.   echo " done."
  3048.   #
  3049.   echo -n "    AX.25: "
  3050.   kissattach -i 44.136.16.1 -m 512 /dev/ttyS1 4800
  3051.   /sbin/ifconfig sl0 netmask 255.255.255.0 broadcast 44.136.16.255
  3052.   /sbin/route add -host 44.136.16.1 sl0
  3053.   /sbin/route add -net 44.136.16.0 netmask 255.255.255.0 window 1024 sl0
  3054.   #
  3055.   echo -n "    tunnel:"
  3056.   /sbin/ifconfig tunl0 44.136.16.1 mtu 512 up
  3057.   #
  3058.   echo done.
  3059.   #
  3060.   echo -n "Routing ... "
  3061.   source /etc/ipip.routes
  3062.   echo done.
  3063.   #
  3064.   # end.
  3065.  
  3066.   and:
  3067.  
  3068.        # /etc/ipip.routes
  3069.        # This file is generated using the munge script
  3070.        #
  3071.        /sbin/route add -net 44.134.8.0 netmask 255.255.255.0 tunl0 gw 134.43.26.1
  3072.        /sbin/route add -net 44.34.9.0 netmask 255.255.255.0 tunl0 gw 174.84.6.17
  3073.        /sbin/route add -net 44.13.28.0 netmask 255.255.255.0 tunl0 gw 212.37.126.3
  3074.           ...
  3075.           ...
  3076.           ...
  3077.  
  3078.   /etc/ax25/axports
  3079.  
  3080.        # name  callsign        speed   paclen  window  description
  3081.        4800    VK2KTJ-0        4800    256     2       144.800 MHz
  3082.  
  3083.   Some points to note here are:
  3084.  
  3085.   ╖  The new tunnel driver uses the gw field in the routing table in
  3086.      place of the pointopoint parameter to specify the address of the
  3087.      remote IPIP gateway. This is why it now supports multiple routes
  3088.      per interface.
  3089.  
  3090.   ╖  You can configure two network devices with the same address.  In
  3091.      this example both the sl0 and the tunl0 devices have been
  3092.      configured with the IP address of the radio port. This is done so
  3093.      that the remote gateway sees the correct address from your gateway
  3094.      in encapsulated datagrams sent to it.
  3095.  
  3096.   ╖  The route commands used to specify the encapsulated routes can be
  3097.      automatically generated by a modified version of the munge script.
  3098.      This is included below. The route commands would then be written to
  3099.      a separate file and read in using the bash source /etc/ipip.routes
  3100.      command (assuming you called the file with the routing commands
  3101.      /etc/ipip.routes) as illustrated. The source file must be in the
  3102.      NOS route command format.
  3103.  
  3104.   ╖  Note the use of the window argument on the route command. Setting
  3105.      this parameter to an appropriate value improves the performance of
  3106.      your radio link.
  3107.  
  3108.   The new tunnel-munge script:
  3109.  
  3110.   #!/bin/sh
  3111.   #
  3112.   # From: Ron Atkinson <n8fow@hamgate.cc.wayne.edu>
  3113.   #
  3114.   #  This script is basically the 'munge' script written by Bdale N3EUA
  3115.   #  for the IPIP daemon and is modified by Ron Atkinson N8FOW. It's
  3116.   #  purpose is to convert a KA9Q NOS format gateways route file
  3117.   #  (usually called 'encap.txt') into a Linux routing table format
  3118.   #  for the IP tunnel driver.
  3119.   #
  3120.   #        Usage: Gateway file on stdin, Linux route format file on stdout.
  3121.   #               eg.  tunnel-munge < encap.txt > ampr-routes
  3122.   #
  3123.   # NOTE: Before you use this script be sure to check or change the
  3124.   #       following items:
  3125.   #
  3126.   #     1) Change the 'Local routes' and 'Misc user routes' sections
  3127.   #        to routes that apply to your own area (remove mine please!)
  3128.   #     2) On the fgrep line be sure to change the IP address to YOUR
  3129.   #        gateway Internet address. Failure to do so will cause serious
  3130.   #        routing loops.
  3131.   #     3) The default interface name is 'tunl0'. Make sure this is
  3132.   #        correct for your system.
  3133.  
  3134.   echo "#"
  3135.   echo "# IP tunnel route table built by $LOGNAME on `date`"
  3136.   echo "# by tunnel-munge script v960307."
  3137.   echo "#"
  3138.   echo "# Local routes"
  3139.   echo "route add -net 44.xxx.xxx.xxx netmask 255.mmm.mmm.mmm dev sl0"
  3140.   echo "#"
  3141.   echo "# Misc user routes"
  3142.   echo "#"
  3143.   echo "# remote routes"
  3144.  
  3145.   fgrep encap | grep "^route" | grep -v " XXX.XXX.XXX.XXX" | \
  3146.   awk '{
  3147.           split($3, s, "/")
  3148.           split(s[1], n,".")
  3149.           if      (n[1] == "")    n[1]="0"
  3150.           if      (n[2] == "")    n[2]="0"
  3151.           if      (n[3] == "")    n[3]="0"
  3152.           if      (n[4] == "")    n[4]="0"
  3153.           if      (s[2] == "1")   mask="128.0.0.0"
  3154.           else if (s[2] == "2")   mask="192.0.0.0"
  3155.           else if (s[2] == "3")   mask="224.0.0.0"
  3156.           else if (s[2] == "4")   mask="240.0.0.0"
  3157.           else if (s[2] == "5")   mask="248.0.0.0"
  3158.           else if (s[2] == "6")   mask="252.0.0.0"
  3159.           else if (s[2] == "7")   mask="254.0.0.0"
  3160.           else if (s[2] == "8")   mask="255.0.0.0"
  3161.           else if (s[2] == "9")   mask="255.128.0.0"
  3162.           else if (s[2] == "10")  mask="255.192.0.0"
  3163.           else if (s[2] == "11")  mask="255.224.0.0"
  3164.           else if (s[2] == "12")  mask="255.240.0.0"
  3165.           else if (s[2] == "13")  mask="255.248.0.0"
  3166.           else if (s[2] == "14")  mask="255.252.0.0"
  3167.           else if (s[2] == "15")  mask="255.254.0.0"
  3168.           else if (s[2] == "16")  mask="255.255.0.0"
  3169.           else if (s[2] == "17")  mask="255.255.128.0"
  3170.           else if (s[2] == "18")  mask="255.255.192.0"
  3171.           else if (s[2] == "19")  mask="255.255.224.0"
  3172.           else if (s[2] == "20")  mask="255.255.240.0"
  3173.           else if (s[2] == "21")  mask="255.255.248.0"
  3174.           else if (s[2] == "22")  mask="255.255.252.0"
  3175.           else if (s[2] == "23")  mask="255.255.254.0"
  3176.           else if (s[2] == "24")  mask="255.255.255.0"
  3177.           else if (s[2] == "25")  mask="255.255.255.128"
  3178.           else if (s[2] == "26")  mask="255.255.255.192"
  3179.           else if (s[2] == "27")  mask="255.255.255.224"
  3180.           else if (s[2] == "28")  mask="255.255.255.240"
  3181.           else if (s[2] == "29")  mask="255.255.255.248"
  3182.           else if (s[2] == "30")  mask="255.255.255.252"
  3183.           else if (s[2] == "31")  mask="255.255.255.254"
  3184.           else                    mask="255.255.255.255"
  3185.  
  3186.   if (mask == "255.255.255.255")
  3187.           printf "route add -host %s.%s.%s.%s gw %s dev tunl0\n"\
  3188.                   ,n[1],n[2],n[3],n[4],$5
  3189.   else
  3190.           printf "route add -net %s.%s.%s.%s gw %s netmask %s dev tunl0\n"\
  3191.                   ,n[1],n[2],n[3],n[4],$5,mask
  3192.    }'
  3193.  
  3194.   echo "#"
  3195.   echo "# default the rest of amprnet via mirrorshades.ucsd.edu"
  3196.   echo "route add -net 44.0.0.0 gw 128.54.16.18 netmask 255.0.0.0 dev tunl0"
  3197.   echo "#"
  3198.   echo "# the end"
  3199.  
  3200.   21.3.  AXIP encapsulated gateway configuration
  3201.  
  3202.   Many Amateur Radio Internet gateways encapsulate AX.25, NetRom and
  3203.   Rose in addition to tcp/ip. Encapsulation of AX.25 frames within IP
  3204.   datagrams is described in RFC-1226 by Brian Kantor. Mike Westerhof
  3205.   wrote an implementation of an AX.25 encapsulation daemon for unix in
  3206.   1991. The ax25-utils package includes a marginally enhanced version of
  3207.   it for Linux.
  3208.  
  3209.   An AXIP encapsulation program accepts AX.25 frames at one end, looks
  3210.   at the destination AX.25 address to determine what IP address to send
  3211.   them to, encapsulates them in a tcp/ip datagram and then transmits
  3212.   them to the appropriate remote destination. It also accepts tcp/ip
  3213.   datagrams that contain AX.25 frames, unwraps them and processes them
  3214.   as if it had received them directly from an AX.25 port. To distinguish
  3215.   IP datagrams containing AX.25 frames from other IP datagrams which
  3216.   don't, AXIP datagrams are coded with a protocol id of 4 (or 94 which
  3217.   is now deprecated). This process is described in RFC-1226.
  3218.  
  3219.   The ax25ipd program included in the ax25-utils package presents itself
  3220.   as a program supporting a KISS interface across which you pass AX.25
  3221.   frames, and an interface into the tcp/ip protocols. It is configured
  3222.   with a single configuration file called /etc/ax25/ax25ipd.conf.
  3223.  
  3224.   21.3.1.  AXIP configuration options.
  3225.  
  3226.   The ax25ipd program has two major modes of operation. "digipeater"
  3227.   mode and "tnc" mode. In "tnc" mode the daemon is treated as though it
  3228.   were a kiss TNC, you pass KISS encapsulated frames to it and it will
  3229.   transmit them, this is the usual configuration. In "digipeater" mode,
  3230.   you treat the daemon as though it were an AX.25 digipeater. There are
  3231.   subtle differences between these modes.
  3232.  
  3233.   In the configuration file you configure "routes" or mappings between
  3234.   destination AX.25 callsigns and the IP addresses of the hosts that you
  3235.   want to send the AX.25 packets too. Each route has options which will
  3236.   be explained later.
  3237.   Other options that are configured here are
  3238.  
  3239.   the tty that the ax25ipd daemon will open and its speed (usually one
  3240.   end of a pipe)
  3241.  
  3242.   what callsign you want to use in "digipeater" mode
  3243.  
  3244.   beacon interval and text
  3245.  
  3246.   whether you want to encapsulate the AX.25 frames in IP datagrams or in
  3247.   UDP/IP datagrams. Nearly all AXIP gateways use IP encapsulation, but
  3248.   some gateways are behind firewalls that will not allow IP with the
  3249.   AXIP protocol id to pass and are forced to use UDP/IP. Whatever you
  3250.   choose must match what the tcp/ip host at the other end of the link is
  3251.   using.
  3252.  
  3253.   21.3.2.  A typical /etc/ax25/ax25ipd.conf file.
  3254.  
  3255.   #
  3256.   # ax25ipd configuration file for station floyd.vk5xxx.ampr.org
  3257.   #
  3258.   # Select axip transport. 'ip' is what you want for compatibility
  3259.   # with most other gateways.
  3260.   #
  3261.   socket ip
  3262.   #
  3263.   # Set ax25ipd mode of operation. (digi or tnc)
  3264.   #
  3265.   mode tnc
  3266.   #
  3267.   # If you selected digi, you must define a callsign.  If you selected
  3268.   # tnc mode, the callsign is currently optional, but this may change
  3269.   # in the future! (2 calls if using dual port kiss)
  3270.   #
  3271.   #mycall vk5xxx-4
  3272.   #mycall2 vk5xxx-5
  3273.   #
  3274.   # In digi mode, you may use an alias. (2 for dual port)
  3275.   #
  3276.   #myalias svwdns
  3277.   #myalias2 svwdn2
  3278.   #
  3279.   # Send an ident every 540 seconds ...
  3280.   #
  3281.   #beacon after 540
  3282.   #btext ax25ip -- tncmode rob/vk5xxx -- Experimental AXIP gateway
  3283.   #
  3284.   # Serial port, or pipe connected to a kissattach in my case
  3285.   #
  3286.   device /dev/ttyq0
  3287.   #
  3288.   # Set the device speed
  3289.   #
  3290.   speed 9600
  3291.   #
  3292.   # loglevel 0 - no output
  3293.   # loglevel 1 - config info only
  3294.   # loglevel 2 - major events and errors
  3295.   # loglevel 3 - major events, errors, and AX25 frame trace
  3296.   # loglevel 4 - all events
  3297.   # log 0 for the moment, syslog not working yet ...
  3298.   #
  3299.   loglevel 2
  3300.   #
  3301.   # If we are in digi mode, we might have a real tnc here, so use param to
  3302.   # set the tnc parameters ...
  3303.   #
  3304.   #param 1 20
  3305.   #
  3306.   # Broadcast Address definition. Any of the addresses listed will be forwarded
  3307.   # to any of the routes flagged as broadcast capable routes.
  3308.   #
  3309.   broadcast QST-0 NODES-0
  3310.   #
  3311.   # ax.25 route definition, define as many as you need.
  3312.   # format is route (call/wildcard) (ip host at destination)
  3313.   # ssid of 0 routes all ssid's
  3314.   #
  3315.   # route <destcall> <destaddr> [flags]
  3316.   #
  3317.   # Valid flags are:
  3318.   #         b  - allow broadcasts to be transmitted via this route
  3319.   #         d  - this route is the default route
  3320.   #
  3321.   route vk2sut-0 44.136.8.68 b
  3322.   route vk5xxx 44.136.188.221 b
  3323.   route vk2abc 44.1.1.1
  3324.   #
  3325.   #
  3326.  
  3327.   21.3.3.  Running ax25ipd
  3328.  
  3329.      Create your /etc/ax25/axports entry:
  3330.  
  3331.           # /etc/ax25/axports
  3332.           #
  3333.           axip    VK2KTJ-13       9600    256     AXIP port
  3334.           #
  3335.  
  3336.      Run the kissattach command to create that port:
  3337.  
  3338.           /usr/sbin/kissattach /dev/ptyq0 axip
  3339.  
  3340.      Run the ax25ipd program:
  3341.  
  3342.           /usr/sbin/ax25ipd &
  3343.  
  3344.      Test the AXIP link:
  3345.  
  3346.           call axip vk5xxx
  3347.  
  3348.   21.3.4.  Some notes about the routes and route flags
  3349.  
  3350.   The "route" command is where you specify where you want your AX.25
  3351.   packets encapsulated and sent to. When the ax25ipd daemon receives a
  3352.   packet from its interface, it compares the destination callsign with
  3353.   each of the callsigns in its routing table. If if finds a match then
  3354.   the ax.25 packet is encapsulated in an IP datagram and then
  3355.   transmitted to the host at the specified IP address.
  3356.  
  3357.   There are two flags you can add to any of the route commands in the
  3358.   ax25ipd.conf file. The two flags are:
  3359.  
  3360.      b  traffic with a destination address matching any of those on the
  3361.         list defined by the "broadcast" keyword should be transmitted
  3362.         via this route.
  3363.  
  3364.      d  any packets not matching any route should be transmitted via
  3365.         this route.
  3366.  
  3367.   The broadcast flag is very useful, as it enables informations that is
  3368.   normally destined for all stations to a number of AXIP destinations.
  3369.   Normally axip routes are point-to-point and unable to handle
  3370.   'broadcast' packets.
  3371.  
  3372.   21.4.  Linking NOS and Linux using a pipe device
  3373.  
  3374.   Many people like to run some version of NOS under Linux because it has
  3375.   all of the features and facilities they are used to. Most of those
  3376.   people would also like to have the NOS running on their machine
  3377.   capable of talking to the Linux kernel so that they can offer some of
  3378.   the linux capabilities to radio users via NOS.
  3379.  
  3380.   Brandon S. Allbery, KF8NH, contributed the following information to
  3381.   explain how to interconnect the NOS running on a Linux machine with
  3382.   the kernel code using the Linux pipe device.
  3383.  
  3384.   Since both Linux and NOS support the slip protocol it is possible to
  3385.   link the two together by creating a slip link. You could do this by
  3386.   using two serial ports with a loopback cable between them, but this
  3387.   would be slow and costly. Linux provides a feature that many other
  3388.   Unix-like operating systems provide called `pipes'. These are special
  3389.   pseudo devices that look like a standard tty device to software but in
  3390.   fact loopback to another pipe device. To use these pipes the first
  3391.   program must open the master end of the pipe, and the open then the
  3392.   second program can open the slave end of the pipe. When both ends are
  3393.   open the programs can communicate with each other simply by writing
  3394.   characters to the pipes in the way they would if they were terminal
  3395.   devices.
  3396.  
  3397.   To use this feature to connect the Linux Kernel and a copy of NOS, or
  3398.   some other program you first must choose a pipe device to use. You can
  3399.   find one by looking in your /dev directory. The master end of the
  3400.   pipes are named: ptyq[1-f] and the slave end of the pipes are known
  3401.   as: ttyq[1-f]. Remember they come in pairs, so if you select
  3402.   /dev/ptyqf as your master end then you must use /dev/ttyqf as the
  3403.   slave end.
  3404.  
  3405.   Once you have chosen a pipe device pair to use you should allocate the
  3406.   master end to you linux kernel and the slave end to the NOS program,
  3407.   as the Linux kernel starts first and the master end of the pipe must
  3408.   be opened first.  You must also remember that your Linux kernel must
  3409.   have a different IP address to your NOS, so you will need to allocate
  3410.   a unique address for it if you haven't already.
  3411.  
  3412.   You configure the pipe just as if it were a serial device, so to
  3413.   create the slip link from your linux kernel you can use commands
  3414.   similar to the following:
  3415.  
  3416.        # /sbin/slattach -s 38400 -p slip /dev/ptyqf &
  3417.        # /sbin/ifconfig sl0 broadcast 44.255.255.255 pointopoint 44.70.248.67 /
  3418.                mtu 1536 44.70.4.88
  3419.        # /sbin/route add 44.70.248.67 sl0
  3420.        # /sbin/route add -net 44.0.0.0 netmask 255.0.0.0 gw 44.70.248.67
  3421.  
  3422.   In this example the Linux kernel has been given IP address 44.70.4.88
  3423.   and the NOS program is using IP address 44.70.248.67. The route
  3424.   command in the last line simply tells your linux kernel to route all
  3425.   datagrams for the amprnet via the slip link created by the slattach
  3426.   command. Normally you would put these commands into your
  3427.   /etc/rc.d/rc.inet2 file after all your other network configuration is
  3428.   complete so that the slip link is created automatically when you
  3429.   reboot.  Note: there is no advantage in using cslip instead of slip as
  3430.   it actually reduces performance because the link is only a virtual one
  3431.   and occurs fast enough that having to compress the headers first takes
  3432.   longer than transmitting the uncompressed datagram.
  3433.  
  3434.   To configure the NOS end of the link you could try the following:
  3435.  
  3436.        # you can call the interface anything you want; I use "linux" for convenience.
  3437.        attach asy ttyqf - slip linux 1024 1024 38400
  3438.        route addprivate 44.70.4.88 linux
  3439.  
  3440.   These commands will create a slip port named `linux' via the slave end
  3441.   of the pipe device pair to your linux kernel, and a route to it to
  3442.   make it work. When you have started NOS you should be able to ping and
  3443.   telnet to your NOS from your Linux machine and vice versa. If not,
  3444.   double check that you have made no mistakes especially that you have
  3445.   the addresses configured properly and have the pipe devices around the
  3446.   right way.
  3447.  
  3448.   22.  Where do I find more information about .... ?
  3449.  
  3450.   Since this document assumes you already have some experience with
  3451.   packet radio and that this might not be the case I've collected a set
  3452.   of references to other information that you might find useful.
  3453.  
  3454.   22.1.  Packet Radio
  3455.  
  3456.   You can get general information about Packet Radio from these sites:
  3457.  
  3458.   American Radio Relay League <http://www.arrl.org/>,
  3459.  
  3460.   Radio Amateur Teleprinter Society <http://www.rats.org/>
  3461.  
  3462.   Tucson Amateur Packet Radio Group <http://www.tapr.org/>
  3463.  
  3464.   22.2.  Protocol Documentation
  3465.  
  3466.   AX.25, NetRom - Jonathon Naylor has collated a variety of documents
  3467.   that relate to the packet radio protocols themselves. This
  3468.   documentation has been packaged up into ax25-doc-1.0.tar.gz
  3469.   <ftp://ftp.pspt.fi/pub/ham/linux/ax25/ax25-doc-1.0.tar.gz>
  3470.  
  3471.   22.3.  Hardware Documentation
  3472.  
  3473.   Information on the PI2 Card is provided by the Ottawa Packet Radio
  3474.   Group <http://hydra.carleton.ca/>.
  3475.  
  3476.   Information on Baycom hardware is available at the Baycom Web Page
  3477.   <http://www.baycom.de/>.
  3478.  
  3479.   23.  Discussion relating to Amateur Radio and Linux.
  3480.  
  3481.   There are various places that discussion relating to Amateur Radio and
  3482.   Linux take place. They take place in the comp.os.linux.* newsgroups,
  3483.   they also take place on the HAMS list on vger.rutgers.edu. Other
  3484.   places where they are held include the tcp-group mailing list at
  3485.   ucsd.edu (the home of amateur radio TCP/IP discussions), and you might
  3486.   also try the #linpeople channel on the linuxnet irc network.
  3487.  
  3488.   To join the Linux linux-hams channel on the mail list server, send
  3489.   mail to:
  3490.  
  3491.        Majordomo@vger.rutgers.edu
  3492.  
  3493.   with the line:
  3494.  
  3495.        subscribe linux-hams
  3496.  
  3497.   in the message body. The subject line is ignored.
  3498.  
  3499.   The linux-hams mailing list is archived at:
  3500.  
  3501.   zone.pspt.fi <http://zone.pspt.fi/archive/linux-hams/> and
  3502.   zone.oh7rba.ampr.org <http://zone.oh7rba.ampr.org/archive/linux-
  3503.   hams/>.  Please use the archives when you are first starting, because
  3504.   many common questions are answered there.
  3505.  
  3506.   To join the tcp-group send mail to:
  3507.  
  3508.        listserver@ucsd.edu
  3509.  
  3510.   with the line:
  3511.  
  3512.        subscribe tcp-group
  3513.  
  3514.   in the body of the text.
  3515.  
  3516.   Note: Please remember that the tcp-group is primarily for discussion
  3517.   of the use of advanced protocols, of which TCP/IP is one, in Amateur
  3518.   Radio. Linux specific questions should not ordinarily go there.
  3519.  
  3520.   24.  Acknowledgements.
  3521.  
  3522.   The following people have contributed to this document in one way or
  3523.   another, knowingly or unknowingly. In no particular order (as I find
  3524.   them): Jonathon Naylor, Thomas Sailer, Joerg Reuter, Ron Atkinson,
  3525.   Alan Cox, Craig Small, John Tanner, Brandon Allbery, Hans Alblas,
  3526.   Klaus Kudielka, Carl Makin.
  3527.  
  3528.   25.  Copyright.
  3529.  
  3530.   The AX25-HOWTO, information on how to install and configure some of
  3531.   the more important packages providing AX25 support for Linux.
  3532.   Copyright (c) 1996 Terry Dawson.
  3533.  
  3534.   This program is free software; you can redistribute it and/or modify
  3535.   it under the terms of the GNU General Public License as published by
  3536.   the Free Software Foundation; either version 2 of the License, or (at
  3537.   your option) any later version.
  3538.  
  3539.   This program is distributed in the hope that it will be useful, but
  3540.   WITHOUT ANY WARRANTY; without even the implied warranty of
  3541.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3542.   General Public License for more details.
  3543.  
  3544.   You should have received a copy of the GNU General Public License
  3545.   along with this program; if not, write to the:
  3546.  
  3547.   Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  3548.   USA.
  3549.  
  3550.